1 #ifndef OPENDMARC_DOT_HPP
2 #define OPENDMARC_DOT_HPP
6 #include <opendmarc/dmarc.h>
8 #include <glog/logging.h>
13 constexpr char const* advice_to_string(advice adv
);
17 lib(lib
const&) = delete;
18 lib
& operator=(lib
const&) = delete;
23 lib
& operator=(lib
&&) = default;
34 policy(policy
const&) = delete;
35 policy
& operator=(policy
const&) = delete;
41 policy(policy
&&) = default;
42 policy
& operator=(policy
&&) = default;
46 void connect(char const* ip
);
47 bool store_from_domain(char const* from_domain
);
48 bool store_dkim(char const* d_equal_domain
,
49 char const* d_selector
,
51 char const* human_result
);
52 bool store_spf(char const* domain
,
55 char const* human_readable
);
56 bool query_dmarc(char const* domain
);
60 DMARC_POLICY_T
* pctx_
{nullptr};
70 constexpr char const* advice_to_string(advice adv
)
73 case advice::ACCEPT
: return "accept";
74 case advice::REJECT
: return "reject";
75 case advice::QUARANTINE
: return "quarantine";
76 case advice::NONE
: break;
81 constexpr char const* policy_spf_to_string(int pol
)
84 case DMARC_POLICY_SPF_OUTCOME_NONE
: return "SPF_OUTCOME_NONE";
85 case DMARC_POLICY_SPF_OUTCOME_PASS
: return "SPF_OUTCOME_PASS";
86 case DMARC_POLICY_SPF_OUTCOME_FAIL
: return "SPF_OUTCOME_FAIL";
87 case DMARC_POLICY_SPF_OUTCOME_TMPFAIL
: return "SPF_OUTCOME_TMPFAIL";
88 case DMARC_POLICY_SPF_ALIGNMENT_PASS
: return "SPF_ALIGNMENT_PASS";
89 case DMARC_POLICY_SPF_ALIGNMENT_FAIL
: return "SPF_ALIGNMENT_FAIL";
94 } // namespace OpenDMARC
96 #endif // OPENDMARC_DOT_HPP