# OPENDMARC_LIB_T

[back to index]

DESCRIPTION |
Purpose | The `OPENDMARC_LIB_T` is used to pass startup information into the library. It is designed to require that nothing inside it needs to ever be allocated nor freed.
Synopsis | #include <dmarc.h> OPENDMARC_LIB_T lib;
OPENDMARC_LIB_T | The items inside the `OPENDMARC_LIB_T` structure, and their legal values are: `int tld_type` Can be assigned one of two possible values: `OPENDMARC_TLD_TYPE_NONE` -- If you do not want to use any TLD file to resolve the organizational domain `OPENDMARC_TLD_TYPE_MOZILLA` -- If you will supply a current version of the `effective_tld_names.dat` file from mozilla.org. `u_char tld_source_file[MAXPATHLEN]` The full or relative path to the TLD file to parse and use. NOTE: If and only if your resolver library lacks the `res_setservers()`interface, the following hooks are avaliable as a substitute.`` `int nscount` If you want the dmarc records looked up by other than the name servers listed in `/etc/resolv.conf` and your resolver library lacks the `res_setservers()`interface. This is the count of the number of entries in `nsaddr_list`.`` `struct sockaddr_in nsaddr_list[MAXNS]` If your resolver library lacks the `res_setservers()`interface, this is an array of IP addresses of name servers to use converted to the type `struct sockaddr_in`.``
Usage | When your program first starts to run, it should pass a pointer to this `OPENDMARC_LIB_T` structure to the `opendmarc_policy_library_init` function, and when your program finally shuts down, it should pass a pointer to this `OPENDMARC_LIB_T` structure to the `opendmarc_policy_library_shutdown` function.
NOTES | `OPENDMARC_LIB_T` is not thread safe. It must only be used once from inside the main thread for startup and shutdown purposes. Multiple threads must not independently attempt to start/stop the library with separate settings.
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.