# opendmarc_policy_connect_init()

[back to index]

SYNOPSIS

    #include <dmarc.h>
    DMARC_POLICY_T * opendmarc_policy_connect_init(
    	u_char *ip_addr, int is_ipv6
    );

Start processing a connection by fetching a pointer of type `DMARC_POLICY_T`. Pre-fill the opaque structure behind that pointer with the connecting IP address and whether or not it is an IPv6 address.

DESCRIPTION

Called When | `opendmarc_policy_connect_init()` may be called after the initial client connection, but before you use any of the library routines that require the `DMARC_POLICY_T` pointer type as input.

ARGUMENTS

Argument | Description
--- | ---
ip_addr | A string containing the IP address of the connecting client.
is_ipv6 | An integer of value 0 if the address in `ip_addr` is an IPv4 address. Or the value non-zero if the address in `ip_addr` is an IPv6 address.

RETURN VALUES

- `DMARC_POLICY_T` * -- on success
- NULL -- On error and sets `errno`

NOTES

- If this function returns NULL it means that no more memory could be allocated.

Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the license.