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
Branches
Tags
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @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 *
* modify it under the terms of the GNU Lesser General Public License *
......@@ -210,6 +210,7 @@ SMBEXPORT ushort SMBCALL smb_hfieldtypelookup(const char*);
SMBEXPORT char* SMBCALL smb_dfieldtype(ushort type);
SMBEXPORT char* SMBCALL smb_faddrtoa(fidoaddr_t* addr, char* outstr);
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 char* SMBCALL smb_zonestr(short zone, char* outstr);
SMBEXPORT char* SMBCALL smb_hashsource(smbmsg_t* msg, int source);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @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 *
* modify it under the terms of the GNU Lesser General Public License *
......@@ -45,57 +45,58 @@ char* SMBCALL smb_hfieldtype(ushort type)
static char str[8];
switch(type) {
case SENDER: return("Sender");
case SENDER: return("Sender"); /* RFC-compliant */
case SENDERAGENT: return("SenderAgent");
case SENDERNETTYPE: return("SenderNetType");
case SENDERNETADDR: return("SenderNetAddr");
case SENDEREXT: return("SenderExt");
case SENDERORG: return("SenderOrg");
case SENDERORG: return("Organization"); /* RFC-compliant */
case SENDERIPADDR: return("SenderIpAddr");
case SENDERHOSTNAME: return("SenderHostName");
case SENDERPROTOCOL: return("SenderProtocol");
case SENDERPORT: return("SenderPort");
case REPLYTO: return("ReplyTo");
case REPLYTOAGENT: return("ReplyToAgent");
case REPLYTONETTYPE: return("ReplyToNetType");
case REPLYTONETADDR: return("ReplyToNetAddr");
case REPLYTOEXT: return("ReplyToExt");
case REPLYTO: return("Reply-To"); /* RFC-compliant */
case REPLYTOAGENT: return("Reply-ToAgent");
case REPLYTONETTYPE: return("Reply-ToNetType");
case REPLYTONETADDR: return("Reply-ToNetAddr");
case REPLYTOEXT: return("Reply-ToExt");
case RECIPIENT: return("Recipient");
case RECIPIENTAGENT: return("RecipientAgent");
case RECIPIENTNETTYPE: return("RecipientNetType");
case RECIPIENTNETADDR: return("RecipientNetAddr");
case RECIPIENTEXT: return("RecipientExt");
case RECIPIENT: return("To"); /* RFC-compliant */
case RECIPIENTAGENT: return("ToAgent");
case RECIPIENTNETTYPE: return("ToNetType");
case RECIPIENTNETADDR: return("ToNetAddr");
case RECIPIENTEXT: return("ToExt");
case SUBJECT: return("Subject");
case SUBJECT: return("Subject"); /* RFC-compliant */
case SMB_SUMMARY: return("Summary");
case SMB_COMMENT: return("Comment");
case SMB_CARBONCOPY: return("CarbonCopy");
case SMB_COMMENT: return("Comment"); /* RFC-compliant */
case SMB_CARBONCOPY: return("CC"); /* RFC-compliant */
case SMB_GROUP: return("Group");
case SMB_EXPIRATION: return("Expiration");
case SMB_PRIORITY: return("Priority");
case SMB_COST: return("Cost");
case FIDOCTRL: return("FidoCtrl");
case FIDOAREA: return("FidoArea");
case FIDOSEENBY: return("FidoSeenBy");
case FIDOPATH: return("FidoPath");
case FIDOMSGID: return("FidoMsgID");
case FIDOREPLYID: return("FidoReplyID");
case FIDOPID: return("FidoPID");
case FIDOFLAGS: return("FidoFlags");
case FIDOTID: return("FidoTID");
/* All X-FTN-* are RFC-compliant */
case FIDOCTRL: return("X-FTN-Kludge");
case FIDOAREA: return("X-FTN-AREA");
case FIDOSEENBY: return("X-FTN-SEEN-BY");
case FIDOPATH: return("X-FTN-PATH");
case FIDOMSGID: return("X-FTN-MSGID");
case FIDOREPLYID: return("X-FTN-REPLY");
case FIDOPID: return("X-FTN-PID");
case FIDOFLAGS: return("X-FTN-Flags");
case FIDOTID: return("X-FTN-TID");
case RFC822HEADER: return("RFC822Header");
case RFC822MSGID: return("RFC822MsgID");
case RFC822REPLYID: return("RFC822ReplyID");
case RFC822MSGID: return("Message-ID"); /* RFC-compliant */
case RFC822REPLYID: return("In-Reply-To"); /* RFC-compliant */
case RFC822TO: return("RFC822To");
case RFC822FROM: return("RFC822From");
case RFC822REPLYTO: return("RFC822ReplyTo");
case USENETPATH: return("UsenetPath");
case USENETNEWSGROUPS: return("UsenetNewsgroups");
case USENETPATH: return("Path"); /* RFC-compliant */
case USENETNEWSGROUPS: return("Newsgroups"); /* RFC-compliant */
case SMTPCOMMAND: return("SMTPCommand");
case SMTPREVERSEPATH: return("SMTPReversePath");
......@@ -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) */
/****************************************************************************/
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)
return(smb_faddrtoa((fidoaddr_t*)net->addr,NULL));
return(smb_faddrtoa((fidoaddr_t*)net->addr,fidoaddr_buf));
return(net->addr);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment