if (str == 0)
return (-1);
-#ifdef AF_INET6
+#ifdef HAS_IPV6
if (strcasecmp(str, "TCP6") == 0) {
if (strchr((char *) proto_info->sa_family_list, AF_INET6) != 0) {
*addr_family = AF_INET6;
return (-1);
switch (addr_family) {
-#ifdef AF_INET6
+#ifdef HAS_IPV6
case AF_INET6:
if (!valid_ipv6_hostaddr(str, DONT_GRIPE))
return (-1);
*sa_len = res->ai_addrlen;
memcpy((void *) sa, res->ai_addr, res->ai_addrlen);
freeaddrinfo(res);
-#ifdef AF_INET6
+#ifdef HAS_IPV6
if (sa->sa_family == AF_INET6)
normalize_v4mapped_sockaddr(sa, sa_len);
#endif
memcpy(port->buf, str, strlen(str) + 1);
if (sa != 0) {
switch (sa->sa_family) {
-#ifdef AF_INET6
+#ifdef HAS_IPV6
case AF_INET6:
SOCK_ADDR_IN6_PORT(sa) = htons(atoi(str));
break;
return (0);
}
-#ifdef AF_INET6
+#ifdef HAS_IPV6
/* haproxy_srvr_parse_v2_addr_v6 - parse IPv6 info from v2 header */
break;
}
case PP2_FAM_INET6 | PP2_TRANS_STREAM:{/* TCP6 */
-#ifdef AF_INET6
+#ifdef HAS_IPV6
if (strchr((char *) proto_info->sa_family_list, AF_INET6) == 0)
return ("Postfix IPv6 support is disabled");
if (ntohs(hdr_v2->len) < PP2_ADDR_LEN_INET6)
#include <unistd.h>
#include <string.h>
+#define SM_CONF_STDBOOL_H 1
#include "libmilter/mfapi.h"
#include "libmilter/mfdef.h"
}
-sfsistat test_header(SMFICTX *ctx, char *name, char *value)
+static sfsistat test_header(SMFICTX *ctx, char *name, char *value)
{
printf("test_header \"%s\" \"%s\"\n", name, value);
return (test_reply(ctx, test_header_reply));
len = strcspn(buf, "\n");
buf[len + 0] = '\r';
buf[len + 1] = '\n';
- if (smfi_replacebody(ctx, buf, len + 2) == MI_FAILURE) {
+ if (smfi_replacebody(ctx,(unsigned char *) buf, len + 2) == MI_FAILURE) {
fprintf(stderr, "body replace failure\n");
exit(1);
}
static int set_macro_state;
static char *set_macro_list;
-typedef sfsistat (*FILTER_ACTION) ();
+typedef sfsistat (*FILTER_ACTION) (SMFICTX *, unsigned char *, size_t);
struct noproto_map {
const char *name;
};
static const struct noproto_map noproto_map[] = {
- "connect", SMFIP_NOCONNECT, SMFIP_NR_CONN, &test_connect_reply, &smfilter.xxfi_connect,
- "helo", SMFIP_NOHELO, SMFIP_NR_HELO, &test_helo_reply, &smfilter.xxfi_helo,
- "mail", SMFIP_NOMAIL, SMFIP_NR_MAIL, &test_mail_reply, &smfilter.xxfi_envfrom,
- "rcpt", SMFIP_NORCPT, SMFIP_NR_RCPT, &test_rcpt_reply, &smfilter.xxfi_envrcpt,
- "data", SMFIP_NODATA, SMFIP_NR_DATA, &test_data_reply, &smfilter.xxfi_data,
- "header", SMFIP_NOHDRS, SMFIP_NR_HDR, &test_header_reply, &smfilter.xxfi_header,
- "eoh", SMFIP_NOEOH, SMFIP_NR_EOH, &test_eoh_reply, &smfilter.xxfi_eoh,
- "body", SMFIP_NOBODY, SMFIP_NR_BODY, &test_body_reply, &smfilter.xxfi_body,
- "unknown", SMFIP_NOUNKNOWN, SMFIP_NR_UNKN, &test_unknown_reply, &smfilter.xxfi_unknown,
+ "connect", SMFIP_NOCONNECT, SMFIP_NR_CONN, &test_connect_reply, (FILTER_ACTION *) & smfilter.xxfi_connect,
+ "helo", SMFIP_NOHELO, SMFIP_NR_HELO, &test_helo_reply, (FILTER_ACTION *) & smfilter.xxfi_helo,
+ "mail", SMFIP_NOMAIL, SMFIP_NR_MAIL, &test_mail_reply, (FILTER_ACTION *) & smfilter.xxfi_envfrom,
+ "rcpt", SMFIP_NORCPT, SMFIP_NR_RCPT, &test_rcpt_reply, (FILTER_ACTION *) & smfilter.xxfi_envrcpt,
+ "data", SMFIP_NODATA, SMFIP_NR_DATA, &test_data_reply, (FILTER_ACTION *) & smfilter.xxfi_data,
+ "header", SMFIP_NOHDRS, SMFIP_NR_HDR, &test_header_reply, (FILTER_ACTION *) & smfilter.xxfi_header,
+ "eoh", SMFIP_NOEOH, SMFIP_NR_EOH, &test_eoh_reply, (FILTER_ACTION *) & smfilter.xxfi_eoh,
+ "body", SMFIP_NOBODY, SMFIP_NR_BODY, &test_body_reply, (FILTER_ACTION *) & smfilter.xxfi_body,
+ "unknown", SMFIP_NOUNKNOWN, SMFIP_NR_UNKN, &test_unknown_reply, (FILTER_ACTION *) & smfilter.xxfi_unknown,
0,
};
DICT *dict_debug_open(const char *name, int open_flags, int dict_flags)
{
static const char myname[] = "dict_debug_open";
+ DICT *real_dict;
+ DICT_DEBUG *dict_debug;
if (msg_verbose)
msg_info("%s: %s", myname, name);
* prevents a config containing both debug:foo:bar and foo:bar from
* creating two DICT objects for foo:bar.
*/
- DICT *real_dict = dict_open(name, open_flags, dict_flags);
- DICT_DEBUG *dict_debug = (DICT_DEBUG *) dict_alloc(DICT_TYPE_DEBUG, name,
- sizeof(*dict_debug));
+ real_dict = dict_open(name, open_flags, dict_flags);
+ dict_debug = (DICT_DEBUG *) dict_alloc(DICT_TYPE_DEBUG, name,
+ sizeof(*dict_debug));
dict_debug->dict.flags = real_dict->flags; /* XXX not synchronized */
dict_debug->dict.lookup = dict_debug_lookup;