Skip to content
Snippets Groups Projects
Commit 29beba34 authored by rswindell's avatar rswindell
Browse files

Changed some of the header field type names returned from smb_hfieldtype()

to be RFC-822 (or RFC-977) compliant.
Added smb_netaddrstr() for a thread-safe version of smb_netaddr().
parent bf3c1cbf
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This library is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
...@@ -210,6 +210,7 @@ SMBEXPORT ushort SMBCALL smb_hfieldtypelookup(const char*); ...@@ -210,6 +210,7 @@ SMBEXPORT ushort SMBCALL smb_hfieldtypelookup(const char*);
SMBEXPORT char* SMBCALL smb_dfieldtype(ushort type); SMBEXPORT char* SMBCALL smb_dfieldtype(ushort type);
SMBEXPORT char* SMBCALL smb_faddrtoa(fidoaddr_t* addr, char* outstr); SMBEXPORT char* SMBCALL smb_faddrtoa(fidoaddr_t* addr, char* outstr);
SMBEXPORT char* SMBCALL smb_netaddr(net_t* net); SMBEXPORT char* SMBCALL smb_netaddr(net_t* net);
SMBEXPORT char* SMBCALL smb_netaddrstr(net_t* net, char* fidoaddr_buf);
SMBEXPORT ushort SMBCALL smb_netaddr_type(const char* str); SMBEXPORT ushort SMBCALL smb_netaddr_type(const char* str);
SMBEXPORT char* SMBCALL smb_zonestr(short zone, char* outstr); SMBEXPORT char* SMBCALL smb_zonestr(short zone, char* outstr);
SMBEXPORT char* SMBCALL smb_hashsource(smbmsg_t* msg, int source); SMBEXPORT char* SMBCALL smb_hashsource(smbmsg_t* msg, int source);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This library is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
...@@ -45,57 +45,58 @@ char* SMBCALL smb_hfieldtype(ushort type) ...@@ -45,57 +45,58 @@ char* SMBCALL smb_hfieldtype(ushort type)
static char str[8]; static char str[8];
switch(type) { switch(type) {
case SENDER: return("Sender"); case SENDER: return("Sender"); /* RFC-compliant */
case SENDERAGENT: return("SenderAgent"); case SENDERAGENT: return("SenderAgent");
case SENDERNETTYPE: return("SenderNetType"); case SENDERNETTYPE: return("SenderNetType");
case SENDERNETADDR: return("SenderNetAddr"); case SENDERNETADDR: return("SenderNetAddr");
case SENDEREXT: return("SenderExt"); case SENDEREXT: return("SenderExt");
case SENDERORG: return("SenderOrg"); case SENDERORG: return("Organization"); /* RFC-compliant */
case SENDERIPADDR: return("SenderIpAddr"); case SENDERIPADDR: return("SenderIpAddr");
case SENDERHOSTNAME: return("SenderHostName"); case SENDERHOSTNAME: return("SenderHostName");
case SENDERPROTOCOL: return("SenderProtocol"); case SENDERPROTOCOL: return("SenderProtocol");
case SENDERPORT: return("SenderPort"); case SENDERPORT: return("SenderPort");
case REPLYTO: return("ReplyTo"); case REPLYTO: return("Reply-To"); /* RFC-compliant */
case REPLYTOAGENT: return("ReplyToAgent"); case REPLYTOAGENT: return("Reply-ToAgent");
case REPLYTONETTYPE: return("ReplyToNetType"); case REPLYTONETTYPE: return("Reply-ToNetType");
case REPLYTONETADDR: return("ReplyToNetAddr"); case REPLYTONETADDR: return("Reply-ToNetAddr");
case REPLYTOEXT: return("ReplyToExt"); case REPLYTOEXT: return("Reply-ToExt");
case RECIPIENT: return("Recipient"); case RECIPIENT: return("To"); /* RFC-compliant */
case RECIPIENTAGENT: return("RecipientAgent"); case RECIPIENTAGENT: return("ToAgent");
case RECIPIENTNETTYPE: return("RecipientNetType"); case RECIPIENTNETTYPE: return("ToNetType");
case RECIPIENTNETADDR: return("RecipientNetAddr"); case RECIPIENTNETADDR: return("ToNetAddr");
case RECIPIENTEXT: return("RecipientExt"); case RECIPIENTEXT: return("ToExt");
case SUBJECT: return("Subject"); case SUBJECT: return("Subject"); /* RFC-compliant */
case SMB_SUMMARY: return("Summary"); case SMB_SUMMARY: return("Summary");
case SMB_COMMENT: return("Comment"); case SMB_COMMENT: return("Comment"); /* RFC-compliant */
case SMB_CARBONCOPY: return("CarbonCopy"); case SMB_CARBONCOPY: return("CC"); /* RFC-compliant */
case SMB_GROUP: return("Group"); case SMB_GROUP: return("Group");
case SMB_EXPIRATION: return("Expiration"); case SMB_EXPIRATION: return("Expiration");
case SMB_PRIORITY: return("Priority"); case SMB_PRIORITY: return("Priority");
case SMB_COST: return("Cost"); case SMB_COST: return("Cost");
case FIDOCTRL: return("FidoCtrl"); /* All X-FTN-* are RFC-compliant */
case FIDOAREA: return("FidoArea"); case FIDOCTRL: return("X-FTN-Kludge");
case FIDOSEENBY: return("FidoSeenBy"); case FIDOAREA: return("X-FTN-AREA");
case FIDOPATH: return("FidoPath"); case FIDOSEENBY: return("X-FTN-SEEN-BY");
case FIDOMSGID: return("FidoMsgID"); case FIDOPATH: return("X-FTN-PATH");
case FIDOREPLYID: return("FidoReplyID"); case FIDOMSGID: return("X-FTN-MSGID");
case FIDOPID: return("FidoPID"); case FIDOREPLYID: return("X-FTN-REPLY");
case FIDOFLAGS: return("FidoFlags"); case FIDOPID: return("X-FTN-PID");
case FIDOTID: return("FidoTID"); case FIDOFLAGS: return("X-FTN-Flags");
case FIDOTID: return("X-FTN-TID");
case RFC822HEADER: return("RFC822Header"); case RFC822HEADER: return("RFC822Header");
case RFC822MSGID: return("RFC822MsgID"); case RFC822MSGID: return("Message-ID"); /* RFC-compliant */
case RFC822REPLYID: return("RFC822ReplyID"); case RFC822REPLYID: return("In-Reply-To"); /* RFC-compliant */
case RFC822TO: return("RFC822To"); case RFC822TO: return("RFC822To");
case RFC822FROM: return("RFC822From"); case RFC822FROM: return("RFC822From");
case RFC822REPLYTO: return("RFC822ReplyTo"); case RFC822REPLYTO: return("RFC822ReplyTo");
case USENETPATH: return("UsenetPath"); case USENETPATH: return("Path"); /* RFC-compliant */
case USENETNEWSGROUPS: return("UsenetNewsgroups"); case USENETNEWSGROUPS: return("Newsgroups"); /* RFC-compliant */
case SMTPCOMMAND: return("SMTPCommand"); case SMTPCOMMAND: return("SMTPCommand");
case SMTPREVERSEPATH: return("SMTPReversePath"); case SMTPREVERSEPATH: return("SMTPReversePath");
...@@ -293,9 +294,17 @@ fidoaddr_t SMBCALL smb_atofaddr(const fidoaddr_t* sys_addr, const char *str) ...@@ -293,9 +294,17 @@ fidoaddr_t SMBCALL smb_atofaddr(const fidoaddr_t* sys_addr, const char *str)
/* Returns ASCIIZ representation of network address (net_t) */ /* Returns ASCIIZ representation of network address (net_t) */
/****************************************************************************/ /****************************************************************************/
char* SMBCALL smb_netaddr(net_t* net) char* SMBCALL smb_netaddr(net_t* net)
{
return(smb_netaddrstr(net, NULL));
}
/****************************************************************************/
/* Copies ASCIIZ representation of network address (net_t) into buf */
/****************************************************************************/
char* SMBCALL smb_netaddrstr(net_t* net, char* fidoaddr_buf)
{ {
if(net->type==NET_FIDO) if(net->type==NET_FIDO)
return(smb_faddrtoa((fidoaddr_t*)net->addr,NULL)); return(smb_faddrtoa((fidoaddr_t*)net->addr,fidoaddr_buf));
return(net->addr); return(net->addr);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment