1 /*
2     pmacct (Promiscuous mode IP Accounting package)
3     pmacct is Copyright (C) 2003-2019 by Paolo Lucente
4 */
5 
6 /*
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11 
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16 
17     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21 
22 const struct _map_dictionary_line tag_map_dictionary[] = {
23   {"id", PT_map_id_handler},
24   {"id2", PT_map_id2_handler},
25   {"ip", PT_map_ip_handler},
26   {"in", PT_map_input_handler},
27   {"out", PT_map_output_handler},
28   {"engine_type", PT_map_engine_type_handler},
29   {"engine_id", PT_map_engine_id_handler},
30   {"source_id", PT_map_engine_id_handler},
31   {"nexthop", PT_map_nexthop_handler},
32   {"bgp_nexthop", PT_map_bgp_nexthop_handler},
33   {"filter", PT_map_filter_handler},
34   {"agent_id", PT_map_agent_id_handler},
35   {"flowset_id", PT_map_flowset_id_handler},
36   {"sample_type", PT_map_sample_type_handler},
37   {"direction", PT_map_direction_handler},
38   {"nat_event", PT_map_nat_event_handler},
39   {"src_as", PT_map_src_as_handler},
40   {"dst_as", PT_map_dst_as_handler},
41   {"peer_src_as", PT_map_peer_src_as_handler},
42   {"peer_dst_as", PT_map_peer_dst_as_handler},
43   {"src_local_pref", PT_map_src_local_pref_handler},
44   {"local_pref", PT_map_local_pref_handler},
45   {"src_roa", PT_map_src_roa_handler},
46   {"dst_roa", PT_map_dst_roa_handler},
47   {"src_comms", PT_map_src_comms_handler},
48   {"comms", PT_map_comms_handler},
49   {"mpls_vpn_rd", PT_map_mpls_vpn_rd_handler},
50   {"mpls_pw_id", PT_map_mpls_pw_id_handler},
51   {"src_mac", PT_map_src_mac_handler},
52   {"dst_mac", PT_map_dst_mac_handler},
53   {"vlan", PT_map_vlan_id_handler},
54   {"cvlan", PT_map_cvlan_id_handler},
55   {"src_net", PT_map_src_net_handler},
56   {"dst_net", PT_map_dst_net_handler},
57   {"set_tag", PT_map_id_handler},
58   {"set_tag2", PT_map_id2_handler},
59   {"set_label", PT_map_label_handler},
60   {"set_tos", PT_map_set_tos_handler},
61   {"label", PT_map_entry_label_handler},
62   {"jeq", PT_map_jeq_handler},
63   {"return", PT_map_return_handler},
64   {"stack", PT_map_stack_handler},
65   {"fwdstatus", PT_map_fwdstatus_handler},
66   {"", NULL}
67 };
68 
69 const struct _map_index_dictionary_line tag_map_index_entries_dictionary[] = {
70   {PRETAG_IP, PT_map_index_entries_ip_handler},
71   {PRETAG_IN_IFACE, PT_map_index_entries_input_handler},
72   {PRETAG_OUT_IFACE, PT_map_index_entries_output_handler},
73   {PRETAG_BGP_NEXTHOP, PT_map_index_entries_bgp_nexthop_handler},
74   {PRETAG_SRC_AS, PT_map_index_entries_src_as_handler},
75   {PRETAG_DST_AS, PT_map_index_entries_dst_as_handler},
76   {PRETAG_PEER_SRC_AS, PT_map_index_entries_peer_src_as_handler},
77   {PRETAG_PEER_DST_AS, PT_map_index_entries_peer_dst_as_handler},
78   {PRETAG_MPLS_LABEL_BOTTOM, PT_map_index_entries_mpls_label_bottom_handler},
79   {PRETAG_MPLS_VPN_ID, PT_map_index_entries_mpls_vpn_id_handler},
80   {PRETAG_MPLS_VPN_RD, PT_map_index_entries_mpls_vpn_rd_handler},
81   {PRETAG_MPLS_PW_ID, PT_map_index_fdata_mpls_pw_id_handler},
82   {PRETAG_SRC_MAC, PT_map_index_entries_src_mac_handler},
83   {PRETAG_DST_MAC, PT_map_index_entries_dst_mac_handler},
84   {PRETAG_VLAN_ID, PT_map_index_entries_vlan_id_handler},
85   {PRETAG_CVLAN_ID, PT_map_index_entries_cvlan_id_handler},
86   {PRETAG_FWDSTATUS_ID, PT_map_index_entries_fwdstatus_handler},
87   {0, NULL}
88 };
89 
90 const struct _map_index_dictionary_line tag_map_index_fdata_dictionary[] = {
91   {PRETAG_IP, PT_map_index_fdata_ip_handler},
92   {PRETAG_IN_IFACE, PT_map_index_fdata_input_handler},
93   {PRETAG_OUT_IFACE, PT_map_index_fdata_output_handler},
94   {PRETAG_BGP_NEXTHOP, PT_map_index_fdata_bgp_nexthop_handler},
95   {PRETAG_SRC_AS, PT_map_index_fdata_src_as_handler},
96   {PRETAG_DST_AS, PT_map_index_fdata_dst_as_handler},
97   {PRETAG_PEER_SRC_AS, PT_map_index_fdata_peer_src_as_handler},
98   {PRETAG_PEER_DST_AS, PT_map_index_fdata_peer_dst_as_handler},
99   {PRETAG_MPLS_LABEL_BOTTOM, PT_map_index_fdata_mpls_label_bottom_handler},
100   {PRETAG_MPLS_VPN_ID, PT_map_index_fdata_mpls_vpn_id_handler},
101   {PRETAG_MPLS_VPN_RD, PT_map_index_fdata_mpls_vpn_rd_handler},
102   {PRETAG_SRC_MAC, PT_map_index_fdata_src_mac_handler},
103   {PRETAG_DST_MAC, PT_map_index_fdata_dst_mac_handler},
104   {PRETAG_VLAN_ID, PT_map_index_fdata_vlan_id_handler},
105   {PRETAG_CVLAN_ID, PT_map_index_fdata_cvlan_id_handler},
106   {PRETAG_FWDSTATUS_ID, PT_map_index_fdata_fwdstatus_handler},
107   {0, NULL}
108 };
109 
110 const struct _map_dictionary_line tag_map_tee_dictionary[] = {
111   {"id", PT_map_id_handler},
112   {"id2", PT_map_id2_handler},
113   {"set_tag", PT_map_id_handler},
114   {"set_tag2", PT_map_id2_handler},
115   {"ip", PT_map_ip_handler},
116   {"in", PT_map_input_handler},
117   {"out", PT_map_output_handler},
118   {"src_mac", PT_map_src_mac_handler},
119   {"dst_mac", PT_map_dst_mac_handler},
120   {"vlan", PT_map_vlan_id_handler},
121   {"src_net", PT_map_src_net_handler},
122   {"dst_net", PT_map_dst_net_handler},
123   {"bgp_nexthop", PT_map_bgp_nexthop_handler},
124   {"engine_type", PT_map_engine_type_handler},
125   {"engine_id", PT_map_engine_id_handler},
126   {"source_id", PT_map_engine_id_handler},
127   {"agent_id", PT_map_agent_id_handler},
128   {"label", PT_map_entry_label_handler},
129   {"jeq", PT_map_jeq_handler},
130   {"return", PT_map_return_handler},
131   {"stack", PT_map_stack_handler},
132   {"", NULL}
133 };
134 
135 const struct _map_dictionary_line bpas_map_dictionary[] = {
136   {"id", PT_map_id_handler},
137   {"ip", PT_map_ip_handler},
138   {"in", PT_map_input_handler},
139   {"out", PT_map_output_handler},
140   {"bgp_nexthop", BPAS_map_bgp_nexthop_handler},
141   {"peer_dst_as", BPAS_map_bgp_peer_dst_as_handler},
142   {"src_mac", PT_map_src_mac_handler},
143   {"vlan", PT_map_vlan_id_handler},
144   {"src_net", PT_map_src_net_handler},
145   {"dst_net", PT_map_dst_net_handler},
146   {"filter", PT_map_filter_handler},
147   {"", NULL}
148 };
149 
150 const struct _map_dictionary_line bta_map_dictionary[] = {
151   {"id", PT_map_id_handler},
152   {"bgp_ip", PT_map_id_handler},
153   {"bgp_port", BTA_map_lookup_bgp_port_handler},
154   {"ip", PT_map_ip_handler},
155   {"in", PT_map_input_handler},
156   {"out", PT_map_output_handler},
157   {"filter", PT_map_filter_handler},
158   {"", NULL}
159 };
160 
161 const struct _map_dictionary_line sampling_map_dictionary[] = {
162   {"id", PT_map_id_handler},
163   {"ip", PT_map_ip_handler},
164   {"in", PT_map_input_handler},
165   {"out", PT_map_output_handler},
166   {"", NULL}
167 };
168 
169 const struct _map_dictionary_line bitr_map_dictionary[] = {
170   {"id", PT_map_id_handler},
171   {"ip", PT_map_ip_handler},
172   {"in", PT_map_input_handler},
173   {"out", PT_map_output_handler},
174   {"bgp_nexthop", PT_map_bgp_nexthop_handler},
175   {"mpls_vpn_id", BITR_map_mpls_vpn_id_handler},
176   {"mpls_label_bottom", BITR_map_mpls_label_bottom_handler},
177   {"", NULL}
178 };
179 
180 const struct _map_dictionary_line custom_primitives_map_dictionary[] = {
181   {"name", custom_primitives_map_name_handler},
182   {"packet_ptr", custom_primitives_map_packet_ptr_handler},
183   {"field_type", custom_primitives_map_field_type_handler},
184   {"len", custom_primitives_map_len_handler},
185   {"semantics", custom_primitives_map_semantics_handler},
186   {"", NULL}
187 };
188 
189 const struct _map_dictionary_line pm_pcap_interfaces_map_dictionary[] = {
190   {"ifindex", pm_pcap_interfaces_map_ifindex_handler},
191   {"ifname", pm_pcap_interfaces_map_ifname_handler},
192   {"direction", pm_pcap_interfaces_map_direction_handler},
193   {"", NULL}
194 };
195