/*++ /* NAME /* normalize_mailhost_addr 3 /* SUMMARY /* normalize mailhost address string representation /* SYNOPSIS /* #include <normalize_mailhost_addr.h> /* /* int normalize_mailhost_addr( /* const char *string, /* char **mailhost_addr, /* char **bare_addr, /* int *addr_family) /* DESCRIPTION /* normalize_mailhost_addr() takes the RFC 2821 string /* representation of an IPv4 or IPv6 network address, and /* normalizes the "IPv6:" prefix and numeric form. An IPv6 or /* IPv4 form is rejected if support for that protocol is /* disabled or non-existent. If both IPv6 and IPv4 support are /* enabled, a V4-in-V6 address is replaced with the IPv4 form. /* /* Arguments: /* .IP string /* Null-terminated string with the RFC 2821 string representation /* of an IPv4 or IPv6 network address. /* .IP mailhost_addr /* Null pointer, or pointer to null-terminated string with the /* normalized RFC 2821 string representation of an IPv4 or /* IPv6 network address. Storage must be freed with myfree(). /* .IP bare_addr /* Null pointer, or pointer to null-terminated string with the /* numeric address without prefix, such as "IPv6:". Storage /* must be freed with myfree(). /* .IP addr_family /* Null pointer, or pointer to integer for storing the address /* family. /* DIAGNOSTICS /* normalize_mailhost_addr() returns -1 if the input is malformed, /* zero otherwise. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
#define UPDATE_BARE_ADDR(s, v) do { \ if (s) myfree(s); \
(s) = mystrdup(v); \
} while(0) #define UPDATE_MAILHOST_ADDR(s, prefix, addr) do { \ if (s) myfree(s); \
(s) = concatenate((prefix), (addr), (char *) 0); \
} while (0)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.