nmsg  0.15.1
compat.h
1 #ifndef NMSG_COMPAT_H
2 #define NMSG_COMPAT_H
3 
4 /*
5  * Protobuf enum refactor compatibility macros.
6  *
7  * Earlier versions of the nmsg.base protobuf schema had package-scope enum
8  * types with overlapping value names. This was incompatible with the C++
9  * protobuf compiler, which generated code with the value names in the scope
10  * of the package rather than prepending the type name to the value as done
11  * by protobuf-c and others.
12  *
13  * To fix this, the enumerated types were moved into the scope of the messages
14  * which used them which changed the protobuf-c generated types and values in
15  * a predicatble manner. These macros allow code to continue to use the previous
16  * protobuf-c generated names for these enum types and values.
17  */
18 
19 #define Nmsg__Base__DnsQRType Nmsg__Base__DnsQR__DnsQRType
20 #define Nmsg__Base__EmailType Nmsg__Base__Email__EmailType
21 #define Nmsg__Base__EncodeType Nmsg__Base__Encode__EncodeType
22 #define Nmsg__Base__HttpType Nmsg__Base__Http__HttpType
23 #define Nmsg__Base__Linktype Nmsg__Base__Linkpair__Linktype
24 #define Nmsg__Base__NcapLegacyType Nmsg__Base__Ncap__NcapLegacyType
25 #define Nmsg__Base__NcapType Nmsg__Base__Ncap__NcapType
26 #define Nmsg__Base__UdpChecksum Nmsg__Base__DnsQR__UdpChecksum
27 
28 #define NMSG__BASE__DNS_QRTYPE__ICMP NMSG__BASE__DNS_QR__DNS_QRTYPE__ICMP
29 #define NMSG__BASE__DNS_QRTYPE__TCP NMSG__BASE__DNS_QR__DNS_QRTYPE__TCP
30 #define NMSG__BASE__DNS_QRTYPE__UDP_INVALID NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_INVALID
31 #define NMSG__BASE__DNS_QRTYPE__UDP_QUERY_ONLY NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_QUERY_ONLY
32 #define NMSG__BASE__DNS_QRTYPE__UDP_QUERY_RESPONSE NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_QUERY_RESPONSE
33 #define NMSG__BASE__DNS_QRTYPE__UDP_RESPONSE_ONLY NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_RESPONSE_ONLY
34 #define NMSG__BASE__DNS_QRTYPE__UDP_UNANSWERED_QUERY NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_UNANSWERED_QUERY
35 #define NMSG__BASE__DNS_QRTYPE__UDP_UNSOLICITED_RESPONSE NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_UNSOLICITED_RESPONSE
36 #define NMSG__BASE__EMAIL_TYPE__rej_content NMSG__BASE__EMAIL__EMAIL_TYPE__rej_content
37 #define NMSG__BASE__EMAIL_TYPE__rej_network NMSG__BASE__EMAIL__EMAIL_TYPE__rej_network
38 #define NMSG__BASE__EMAIL_TYPE__rej_user NMSG__BASE__EMAIL__EMAIL_TYPE__rej_user
39 #define NMSG__BASE__EMAIL_TYPE__spamtrap NMSG__BASE__EMAIL__EMAIL_TYPE__spamtrap
40 #define NMSG__BASE__EMAIL_TYPE__unknown NMSG__BASE__EMAIL__EMAIL_TYPE__unknown
41 #define NMSG__BASE__ENCODE_TYPE__JSON NMSG__BASE__ENCODE__ENCODE_TYPE__JSON
42 #define NMSG__BASE__ENCODE_TYPE__MSGPACK NMSG__BASE__ENCODE__ENCODE_TYPE__MSGPACK
43 #define NMSG__BASE__ENCODE_TYPE__TEXT NMSG__BASE__ENCODE__ENCODE_TYPE__TEXT
44 #define NMSG__BASE__ENCODE_TYPE__XML NMSG__BASE__ENCODE__ENCODE_TYPE__XML
45 #define NMSG__BASE__ENCODE_TYPE__YAML NMSG__BASE__ENCODE__ENCODE_TYPE__YAML
46 #define NMSG__BASE__HTTP_TYPE__sinkhole NMSG__BASE__HTTP__HTTP_TYPE__sinkhole
47 #define NMSG__BASE__HTTP_TYPE__unknown NMSG__BASE__HTTP__HTTP_TYPE__unknown
48 #define NMSG__BASE__LINKTYPE__ANCHOR NMSG__BASE__LINKPAIR__LINKTYPE__ANCHOR
49 #define NMSG__BASE__LINKTYPE__REDIRECT NMSG__BASE__LINKPAIR__LINKTYPE__REDIRECT
50 #define NMSG__BASE__LINKTYPE__anchor NMSG__BASE__LINKPAIR__LINKTYPE__anchor
51 #define NMSG__BASE__LINKTYPE__redirect NMSG__BASE__LINKPAIR__LINKTYPE__redirect
52 #define NMSG__BASE__NCAP_LEGACY_TYPE__ICMP NMSG__BASE__NCAP__NCAP_LEGACY_TYPE__ICMP
53 #define NMSG__BASE__NCAP_LEGACY_TYPE__TCP NMSG__BASE__NCAP__NCAP_LEGACY_TYPE__TCP
54 #define NMSG__BASE__NCAP_LEGACY_TYPE__UDP NMSG__BASE__NCAP__NCAP_LEGACY_TYPE__UDP
55 #define NMSG__BASE__NCAP_TYPE__IPV4 NMSG__BASE__NCAP__NCAP_TYPE__IPV4
56 #define NMSG__BASE__NCAP_TYPE__IPV6 NMSG__BASE__NCAP__NCAP_TYPE__IPV6
57 #define NMSG__BASE__NCAP_TYPE__Legacy NMSG__BASE__NCAP__NCAP_TYPE__Legacy
58 #define NMSG__BASE__UDP_CHECKSUM__ABSENT NMSG__BASE__DNS_QR__UDP_CHECKSUM__ABSENT
59 #define NMSG__BASE__UDP_CHECKSUM__CORRECT NMSG__BASE__DNS_QR__UDP_CHECKSUM__CORRECT
60 #define NMSG__BASE__UDP_CHECKSUM__ERROR NMSG__BASE__DNS_QR__UDP_CHECKSUM__ERROR
61 #define NMSG__BASE__UDP_CHECKSUM__INCORRECT NMSG__BASE__DNS_QR__UDP_CHECKSUM__INCORRECT
62 
63 /*
64  * isc -> base rename compatibility macros.
65  */
66 
67 #define NMSG_VENDOR_ISC_NCAP_ID NMSG_VENDOR_BASE_NCAP_ID
68 #define NMSG_VENDOR_ISC_NCAP_NAME NMSG_VENDOR_BASE_NCAP_NAME
69 #define NMSG_VENDOR_ISC_EMAIL_ID NMSG_VENDOR_BASE_EMAIL_ID
70 #define NMSG_VENDOR_ISC_EMAIL_NAME NMSG_VENDOR_BASE_EMAIL_NAME
71 #define NMSG_VENDOR_ISC_LINKPAIR_ID NMSG_VENDOR_BASE_LINKPAIR_ID
72 #define NMSG_VENDOR_ISC_LINKPAIR_NAME NMSG_VENDOR_BASE_LINKPAIR_NAME
73 #define NMSG_VENDOR_ISC_HTTP_ID NMSG_VENDOR_BASE_HTTP_ID
74 #define NMSG_VENDOR_ISC_HTTP_NAME NMSG_VENDOR_BASE_HTTP_NAME
75 #define NMSG_VENDOR_ISC_IPCONN_ID NMSG_VENDOR_BASE_IPCONN_ID
76 #define NMSG_VENDOR_ISC_IPCONN_NAME NMSG_VENDOR_BASE_IPCONN_NAME
77 #define NMSG_VENDOR_ISC_LOGLINE_ID NMSG_VENDOR_BASE_LOGLINE_ID
78 #define NMSG_VENDOR_ISC_LOGLINE_NAME NMSG_VENDOR_BASE_LOGLINE_NAME
79 #define NMSG_VENDOR_ISC_DNS_ID NMSG_VENDOR_BASE_DNS_ID
80 #define NMSG_VENDOR_ISC_DNS_NAME NMSG_VENDOR_BASE_DNS_NAME
81 #define NMSG_VENDOR_ISC_PKT_ID NMSG_VENDOR_BASE_PKT_ID
82 #define NMSG_VENDOR_ISC_PKT_NAME NMSG_VENDOR_BASE_PKT_NAME
83 #define NMSG_VENDOR_ISC_DNSQR_ID NMSG_VENDOR_BASE_DNSQR_ID
84 #define NMSG_VENDOR_ISC_DNSQR_NAME NMSG_VENDOR_BASE_DNSQR_NAME
85 #define NMSG_VENDOR_ISC_XML_ID NMSG_VENDOR_BASE_XML_ID
86 #define NMSG_VENDOR_ISC_XML_NAME NMSG_VENDOR_BASE_XML_NAME
87 #define NMSG_VENDOR_ISC_ENCODE_ID NMSG_VENDOR_BASE_ENCODE_ID
88 #define NMSG_VENDOR_ISC_ENCODE_NAME NMSG_VENDOR_BASE_ENCODE_NAME
89 
90 #define Nmsg__Isc__Dns Nmsg__Base__Dns
91 #define Nmsg__Isc__DnsQR Nmsg__Base__DnsQR
92 #define Nmsg__Isc__DnsQRType Nmsg__Base__DnsQR__DnsQRType
93 #define Nmsg__Isc__Email Nmsg__Base__Email
94 #define Nmsg__Isc__EmailType Nmsg__Base__Email__EmailType
95 #define Nmsg__Isc__Encode Nmsg__Base__Encode
96 #define Nmsg__Isc__EncodeType Nmsg__Base__Encode__EncodeType
97 #define Nmsg__Isc__Http Nmsg__Base__Http
98 #define Nmsg__Isc__HttpType Nmsg__Base__Http__HttpType
99 #define Nmsg__Isc__IPConn Nmsg__Base__IPConn
100 #define Nmsg__Isc__Linkpair Nmsg__Base__Linkpair
101 #define Nmsg__Isc__Linktype Nmsg__Base__Linkpair__Linktype
102 #define Nmsg__Isc__LogLine Nmsg__Base__LogLine
103 #define Nmsg__Isc__Ncap Nmsg__Base__Ncap
104 #define Nmsg__Isc__NcapLegacyType Nmsg__Base__Ncap__NcapLegacyType
105 #define Nmsg__Isc__NcapType Nmsg__Base__Ncap__NcapType
106 #define Nmsg__Isc__Pkt Nmsg__Base__Pkt
107 #define Nmsg__Isc__UdpChecksum Nmsg__Base__DnsQR__UdpChecksum
108 #define Nmsg__Isc__Xml Nmsg__Base__Xml
109 
110 #define NMSG__ISC__DNS_QRTYPE__ICMP NMSG__BASE__DNS_QR__DNS_QRTYPE__ICMP
111 #define NMSG__ISC__DNS_QRTYPE__TCP NMSG__BASE__DNS_QR__DNS_QRTYPE__TCP
112 #define NMSG__ISC__DNS_QRTYPE__UDP_INVALID NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_INVALID
113 #define NMSG__ISC__DNS_QRTYPE__UDP_QUERY_ONLY NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_QUERY_ONLY
114 #define NMSG__ISC__DNS_QRTYPE__UDP_QUERY_RESPONSE NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_QUERY_RESPONSE
115 #define NMSG__ISC__DNS_QRTYPE__UDP_RESPONSE_ONLY NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_RESPONSE_ONLY
116 #define NMSG__ISC__DNS_QRTYPE__UDP_UNANSWERED_QUERY NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_UNANSWERED_QUERY
117 #define NMSG__ISC__DNS_QRTYPE__UDP_UNSOLICITED_RESPONSE NMSG__BASE__DNS_QR__DNS_QRTYPE__UDP_UNSOLICITED_RESPONSE
118 #define NMSG__ISC__EMAIL_TYPE__REJ_CONTENT NMSG__BASE__EMAIL__EMAIL_TYPE__REJ_CONTENT
119 #define NMSG__ISC__EMAIL_TYPE__REJ_NETWORK NMSG__BASE__EMAIL__EMAIL_TYPE__REJ_NETWORK
120 #define NMSG__ISC__EMAIL_TYPE__REJ_USER NMSG__BASE__EMAIL__EMAIL_TYPE__REJ_USER
121 #define NMSG__ISC__EMAIL_TYPE__SPAMTRAP NMSG__BASE__EMAIL__EMAIL_TYPE__SPAMTRAP
122 #define NMSG__ISC__EMAIL_TYPE__UNKNOWN NMSG__BASE__EMAIL__EMAIL_TYPE__UNKNOWN
123 #define NMSG__ISC__EMAIL_TYPE__rej_content NMSG__BASE__EMAIL__EMAIL_TYPE__rej_content
124 #define NMSG__ISC__EMAIL_TYPE__rej_network NMSG__BASE__EMAIL__EMAIL_TYPE__rej_network
125 #define NMSG__ISC__EMAIL_TYPE__rej_user NMSG__BASE__EMAIL__EMAIL_TYPE__rej_user
126 #define NMSG__ISC__EMAIL_TYPE__spamtrap NMSG__BASE__EMAIL__EMAIL_TYPE__spamtrap
127 #define NMSG__ISC__EMAIL_TYPE__unknown NMSG__BASE__EMAIL__EMAIL_TYPE__unknown
128 #define NMSG__ISC__ENCODE_TYPE__JSON NMSG__BASE__ENCODE__ENCODE_TYPE__JSON
129 #define NMSG__ISC__ENCODE_TYPE__MSGPACK NMSG__BASE__ENCODE__ENCODE_TYPE__MSGPACK
130 #define NMSG__ISC__ENCODE_TYPE__TEXT NMSG__BASE__ENCODE__ENCODE_TYPE__TEXT
131 #define NMSG__ISC__ENCODE_TYPE__XML NMSG__BASE__ENCODE__ENCODE_TYPE__XML
132 #define NMSG__ISC__ENCODE_TYPE__YAML NMSG__BASE__ENCODE__ENCODE_TYPE__YAML
133 #define NMSG__ISC__HTTP_TYPE__SINKHOLE NMSG__BASE__HTTP__HTTP_TYPE__SINKHOLE
134 #define NMSG__ISC__HTTP_TYPE__UNKNOWN NMSG__BASE__HTTP__HTTP_TYPE__UNKNOWN
135 #define NMSG__ISC__HTTP_TYPE__sinkhole NMSG__BASE__HTTP__HTTP_TYPE__sinkhole
136 #define NMSG__ISC__HTTP_TYPE__unknown NMSG__BASE__HTTP__HTTP_TYPE__unknown
137 #define NMSG__ISC__LINKTYPE__ANCHOR NMSG__BASE__LINKPAIR__LINKTYPE__ANCHOR
138 #define NMSG__ISC__LINKTYPE__REDIRECT NMSG__BASE__LINKPAIR__LINKTYPE__REDIRECT
139 #define NMSG__ISC__LINKTYPE__anchor NMSG__BASE__LINKPAIR__LINKTYPE__anchor
140 #define NMSG__ISC__LINKTYPE__redirect NMSG__BASE__LINKPAIR__LINKTYPE__redirect
141 #define NMSG__ISC__NCAP_LEGACY_TYPE__ICMP NMSG__BASE__NCAP__NCAP_LEGACY_TYPE__ICMP
142 #define NMSG__ISC__NCAP_LEGACY_TYPE__TCP NMSG__BASE__NCAP__NCAP_LEGACY_TYPE__TCP
143 #define NMSG__ISC__NCAP_LEGACY_TYPE__UDP NMSG__BASE__NCAP__NCAP_LEGACY_TYPE__UDP
144 #define NMSG__ISC__NCAP_TYPE__IPV4 NMSG__BASE__NCAP__NCAP_TYPE__IPV4
145 #define NMSG__ISC__NCAP_TYPE__IPV6 NMSG__BASE__NCAP__NCAP_TYPE__IPV6
146 #define NMSG__ISC__NCAP_TYPE__LEGACY NMSG__BASE__NCAP__NCAP_TYPE__LEGACY
147 #define NMSG__ISC__NCAP_TYPE__Legacy NMSG__BASE__NCAP__NCAP_TYPE__Legacy
148 #define NMSG__ISC__UDP_CHECKSUM__ABSENT NMSG__BASE__DNS_QR__UDP_CHECKSUM__ABSENT
149 #define NMSG__ISC__UDP_CHECKSUM__CORRECT NMSG__BASE__DNS_QR__UDP_CHECKSUM__CORRECT
150 #define NMSG__ISC__UDP_CHECKSUM__ERROR NMSG__BASE__DNS_QR__UDP_CHECKSUM__ERROR
151 #define NMSG__ISC__UDP_CHECKSUM__INCORRECT NMSG__BASE__DNS_QR__UDP_CHECKSUM__INCORRECT
152 
153 #endif /* NMSG_COMPAT_H */