diff --git a/src/smblib/smblib.c b/src/smblib/smblib.c index 55c1ee97362108a899562de5f1b432584579cb07..04c13c1330f4c75965d6954828920be883cfbbc6 100644 --- a/src/smblib/smblib.c +++ b/src/smblib/smblib.c @@ -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 */