Skip to content
Snippets Groups Projects
Commit 9768680a authored by rswindell's avatar rswindell
Browse files

Created smb_get_hfield() function - searches for specific header field by type.

Added support for USENET path and newsgroups header fields.
parent a116043a
No related branches found
No related tags found
No related merge requests found
......@@ -799,6 +799,12 @@ int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg)
case RFC822REPLYID:
msg->reply_id=msg->hfield_dat[i];
break;
case USENETPATH:
msg->path=msg->hfield_dat[i];
break;
case USENETNEWSGROUPS:
msg->newsgroups=msg->hfield_dat[i];
break;
case FIDOMSGID:
msg->ftn_msgid=msg->hfield_dat[i];
break;
......@@ -929,6 +935,22 @@ int SMBCALL smb_hfield(smbmsg_t* msg, ushort type, size_t length, void* data)
return(0);
}
/****************************************************************************/
/* Searches for a specific header field (by type) and returns it */
/****************************************************************************/
void* SMBCALL smb_get_hfield(smbmsg_t* msg, ushort type, hfield_t* hfield)
{
int i;
for(i=0;i<msg->total_hfields;i++)
if(msg->hfield[i].type == type) {
hfield = &msg->hfield[i];
return(msg->hfield_dat[i]);
}
return(NULL);
}
/****************************************************************************/
/* Adds a data field to the 'msg' structure (in memory only) */
/* Automatically figures out the offset into the data buffer from existing */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment