Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 1 | /* |
| 2 | ************************************************************************** |
Murat Sezgin | 9304d47 | 2017-04-14 10:16:52 -0700 | [diff] [blame] | 3 | * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all copies. |
| 7 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 8 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 9 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 10 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 11 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 12 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
| 13 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 14 | ************************************************************************** |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | * API's |
| 19 | */ |
ratheesh kannoth | 37e35b0 | 2015-03-26 11:25:02 +0530 | [diff] [blame] | 20 | #ifndef ECM_DB_H_ |
| 21 | #define ECM_DB_H_ |
| 22 | |
Murat Sezgin | 1134fb8 | 2015-10-06 14:03:49 -0700 | [diff] [blame] | 23 | #include <net/netfilter/nf_conntrack.h> |
| 24 | |
Murat Sezgin | fdb595e | 2016-05-10 11:27:37 -0700 | [diff] [blame] | 25 | void ecm_db_front_end_instance_ref_and_set(struct ecm_db_connection_instance *ci, struct ecm_front_end_connection_instance *feci); |
Murat Sezgin | 1134fb8 | 2015-10-06 14:03:49 -0700 | [diff] [blame] | 26 | struct ecm_db_connection_instance *ecm_db_connection_ipv4_from_ct_get_and_ref(struct nf_conn *ct); |
| 27 | struct ecm_db_connection_instance *ecm_db_connection_ipv6_from_ct_get_and_ref(struct nf_conn *ct); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 28 | uint32_t ecm_db_time_get(void); |
| 29 | void ecm_db_connection_defunct_all(void); |
Gareth Williams | d5618a8 | 2015-05-20 11:13:32 +0100 | [diff] [blame] | 30 | #ifdef ECM_DB_XREF_ENABLE |
Murat Sezgin | 9304d47 | 2017-04-14 10:16:52 -0700 | [diff] [blame] | 31 | void ecm_db_traverse_node_from_connection_list_and_defunct(struct ecm_db_node_instance *node); |
| 32 | void ecm_db_traverse_node_to_connection_list_and_defunct(struct ecm_db_node_instance *node); |
| 33 | void ecm_db_traverse_node_from_nat_connection_list_and_defunct(struct ecm_db_node_instance *node); |
| 34 | void ecm_db_traverse_node_to_nat_connection_list_and_defunct(struct ecm_db_node_instance *node); |
Murat Sezgin | 8c34582 | 2015-05-27 15:35:38 -0700 | [diff] [blame] | 35 | #endif |
Gareth Williams | f28ba5f | 2015-02-13 11:07:28 +0000 | [diff] [blame] | 36 | int ecm_db_connection_count_get(void); |
| 37 | |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 38 | void ecm_db_connection_data_totals_update_dropped(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets); |
| 39 | void ecm_db_connection_data_totals_update(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets); |
| 40 | |
| 41 | bool ecm_db_connection_defunct_timer_reset(struct ecm_db_connection_instance *ci, ecm_db_timer_group_t tg); |
| 42 | bool ecm_db_connection_defunct_timer_touch(struct ecm_db_connection_instance *ci); |
| 43 | void ecm_db_connection_make_defunct(struct ecm_db_connection_instance *ci); |
| 44 | |
| 45 | uint32_t ecm_db_connection_serial_get(struct ecm_db_connection_instance *ci); |
| 46 | |
| 47 | void ecm_db_connection_from_address_get(struct ecm_db_connection_instance *ci, ip_addr_t addr); |
| 48 | void ecm_db_connection_from_address_nat_get(struct ecm_db_connection_instance *ci, ip_addr_t addr); |
| 49 | void ecm_db_connection_to_address_get(struct ecm_db_connection_instance *ci, ip_addr_t addr); |
| 50 | void ecm_db_connection_to_address_nat_get(struct ecm_db_connection_instance *ci, ip_addr_t addr); |
| 51 | int ecm_db_connection_to_port_get(struct ecm_db_connection_instance *ci); |
| 52 | int ecm_db_connection_to_port_nat_get(struct ecm_db_connection_instance *ci); |
| 53 | int ecm_db_connection_from_port_get(struct ecm_db_connection_instance *ci); |
| 54 | int ecm_db_connection_from_port_nat_get(struct ecm_db_connection_instance *ci); |
| 55 | |
| 56 | void ecm_db_node_adress_get(struct ecm_db_node_instance *ni, uint8_t *address_buffer); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 57 | |
| 58 | void ecm_db_connection_from_node_address_get(struct ecm_db_connection_instance *ci, uint8_t *address_buffer); |
| 59 | void ecm_db_connection_to_node_address_get(struct ecm_db_connection_instance *ci, uint8_t *address_buffer); |
| 60 | void ecm_db_connection_to_nat_node_address_get(struct ecm_db_connection_instance *ci, uint8_t *address_buffer); |
| 61 | void ecm_db_connection_from_nat_node_address_get(struct ecm_db_connection_instance *ci, uint8_t *address_buffer); |
| 62 | void ecm_db_connection_to_iface_name_get(struct ecm_db_connection_instance *ci, char *name_buffer); |
| 63 | void ecm_db_connection_from_iface_name_get(struct ecm_db_connection_instance *ci, char *name_buffer); |
| 64 | int ecm_db_connection_from_iface_mtu_get(struct ecm_db_connection_instance *ci); |
| 65 | ecm_db_iface_type_t ecm_db_connection_from_iface_type_get(struct ecm_db_connection_instance *ci); |
| 66 | int ecm_db_connection_to_iface_mtu_get(struct ecm_db_connection_instance *ci); |
| 67 | ecm_db_iface_type_t ecm_db_connection_to_iface_type_get(struct ecm_db_connection_instance *ci); |
| 68 | |
| 69 | ecm_db_iface_type_t ecm_db_connection_iface_type_get(struct ecm_db_iface_instance *ii); |
| 70 | int32_t ecm_db_iface_mtu_reset(struct ecm_db_iface_instance *ii, int32_t mtu); |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 71 | int32_t ecm_db_iface_ae_interface_identifier_get(struct ecm_db_iface_instance *ii); |
Murat Sezgin | 5f2947a | 2016-06-28 12:09:33 -0700 | [diff] [blame] | 72 | void ecm_db_iface_ae_interface_identifier_set(struct ecm_db_iface_instance *ii, uint32_t num); |
Kiran Kumar C. S. K | 451b62e | 2014-05-19 20:34:06 +0530 | [diff] [blame] | 73 | int32_t ecm_db_iface_interface_identifier_get(struct ecm_db_iface_instance *ii); |
Murat Sezgin | 3aea6c9 | 2015-11-13 13:14:12 -0800 | [diff] [blame] | 74 | void ecm_db_iface_interface_name_get(struct ecm_db_iface_instance *ii, char *name_buffer); |
Shyam Sunder | 39e2567 | 2015-09-03 14:28:09 +0530 | [diff] [blame] | 75 | void ecm_db_iface_identifier_hash_table_entry_check_and_update(struct ecm_db_iface_instance *ii, int32_t new_interface_identifier); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 76 | |
| 77 | struct ecm_front_end_connection_instance *ecm_db_connection_front_end_get_and_ref(struct ecm_db_connection_instance *ci); |
| 78 | |
| 79 | void ecm_db_connection_data_stats_get(struct ecm_db_connection_instance *ci, uint64_t *from_data_total, uint64_t *to_data_total, uint64_t *from_packet_total, uint64_t *to_packet_total, uint64_t *from_data_total_dropped, uint64_t *to_data_total_dropped, uint64_t *from_packet_total_dropped, uint64_t *to_packet_total_dropped); |
| 80 | |
Tushar Mathur | d38cacd | 2015-07-28 12:19:10 +0530 | [diff] [blame] | 81 | uint16_t ecm_db_connection_regeneration_occurrances_get(struct ecm_db_connection_instance *ci); |
| 82 | void ecm_db_conection_regeneration_completed(struct ecm_db_connection_instance *ci); |
| 83 | void ecm_db_conection_regeneration_failed(struct ecm_db_connection_instance *ci); |
| 84 | bool ecm_db_connection_regeneration_required_check(struct ecm_db_connection_instance *ci); |
| 85 | bool ecm_db_connection_regeneration_required_peek(struct ecm_db_connection_instance *ci); |
| 86 | void ecm_db_connection_regeneration_needed(struct ecm_db_connection_instance *ci); |
| 87 | void ecm_db_regeneration_needed(void); |
Xiaoping Fan | ed6d37e | 2015-09-17 14:13:47 -0700 | [diff] [blame] | 88 | void ecm_db_connection_regenerate(struct ecm_db_connection_instance *ci); |
Gareth Williams | b39e7c2 | 2015-03-25 10:15:33 +0000 | [diff] [blame] | 89 | #ifdef ECM_DB_CTA_TRACK_ENABLE |
Gareth Williams | dd6dfce | 2014-10-14 15:51:31 +0100 | [diff] [blame] | 90 | void ecm_db_connection_regenerate_by_assignment_type(ecm_classifier_type_t ca_type); |
| 91 | void ecm_db_connection_make_defunct_by_assignment_type(ecm_classifier_type_t ca_type); |
Gareth Williams | b39e7c2 | 2015-03-25 10:15:33 +0000 | [diff] [blame] | 92 | #endif |
Gareth Williams | dd6dfce | 2014-10-14 15:51:31 +0100 | [diff] [blame] | 93 | |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 94 | ecm_db_direction_t ecm_db_connection_direction_get(struct ecm_db_connection_instance *ci); |
| 95 | |
| 96 | void ecm_db_mapping_port_count_get(struct ecm_db_mapping_instance *mi, int *tcp_from, int *tcp_to, int *udp_from, int *udp_to, int *from, int *to, int *tcp_nat_from, int *tcp_nat_to, int *udp_nat_from, int *udp_nat_to, int *nat_from, int *nat_to); |
| 97 | |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 98 | void ecm_db_host_address_get(struct ecm_db_host_instance *hi, ip_addr_t addr); |
| 99 | bool ecm_db_host_on_link_get(struct ecm_db_host_instance *hi); |
| 100 | |
| 101 | void ecm_db_mapping_adress_get(struct ecm_db_mapping_instance *mi, ip_addr_t addr); |
| 102 | int ecm_db_mapping_port_get(struct ecm_db_mapping_instance *mi); |
| 103 | |
| 104 | int ecm_db_connection_protocol_get(struct ecm_db_connection_instance *ci); |
Gareth Williams | 3e5b37f | 2015-05-13 10:04:12 +0100 | [diff] [blame] | 105 | int ecm_db_connection_ip_version_get(struct ecm_db_connection_instance *ci); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 106 | bool ecm_db_connection_is_routed_get(struct ecm_db_connection_instance *ci); |
| 107 | |
| 108 | void ecm_db_connection_data_totals_update_tracked(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets); |
| 109 | void ecm_db_connection_data_totals_update_dropped(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets); |
| 110 | |
| 111 | ecm_db_timer_group_t ecm_db_connection_timer_group_get(struct ecm_db_connection_instance *ci); |
| 112 | void ecm_db_timer_group_entry_init(struct ecm_db_timer_group_entry *tge, ecm_db_timer_group_entry_callback_t fn, void *arg); |
| 113 | void ecm_db_timer_group_entry_set(struct ecm_db_timer_group_entry *tge, ecm_db_timer_group_t tg); |
| 114 | bool ecm_db_timer_group_entry_reset(struct ecm_db_timer_group_entry *tge, ecm_db_timer_group_t tg); |
| 115 | bool ecm_db_timer_group_entry_remove(struct ecm_db_timer_group_entry *tge); |
| 116 | bool ecm_db_timer_group_entry_touch(struct ecm_db_timer_group_entry *tge); |
| 117 | |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 118 | int ecm_db_mapping_connections_total_count_get(struct ecm_db_mapping_instance *mi); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 119 | |
| 120 | struct ecm_db_host_instance *ecm_db_mapping_host_get_and_ref(struct ecm_db_mapping_instance *mi); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 121 | struct ecm_db_iface_instance *ecm_db_node_iface_get_and_ref(struct ecm_db_node_instance *ni); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 122 | |
| 123 | struct ecm_db_mapping_instance *ecm_db_connection_mapping_from_get_and_ref(struct ecm_db_connection_instance *ci); |
| 124 | struct ecm_db_mapping_instance *ecm_db_connection_mapping_to_get_and_ref(struct ecm_db_connection_instance *ci); |
| 125 | struct ecm_db_mapping_instance *ecm_db_connection_mapping_nat_from_get_and_ref(struct ecm_db_connection_instance *ci); |
| 126 | struct ecm_db_mapping_instance *ecm_db_connection_mapping_nat_to_get_and_ref(struct ecm_db_connection_instance *ci); |
| 127 | struct ecm_db_node_instance *ecm_db_connection_node_from_get_and_ref(struct ecm_db_connection_instance *ci); |
| 128 | struct ecm_db_node_instance *ecm_db_connection_node_to_get_and_ref(struct ecm_db_connection_instance *ci); |
| 129 | |
| 130 | struct ecm_db_host_instance *ecm_db_host_find_and_ref(ip_addr_t address); |
| 131 | |
| 132 | struct ecm_db_mapping_instance *ecm_db_mapping_find_and_ref(ip_addr_t address, int port); |
| 133 | |
| 134 | struct ecm_db_connection_instance *ecm_db_connection_serial_find_and_ref(uint32_t serial); |
| 135 | struct ecm_db_connection_instance *ecm_db_connection_find_and_ref(ip_addr_t host1_addr, ip_addr_t host2_addr, int protocol, int host1_port, int host2_port); |
| 136 | |
| 137 | void ecm_db_iface_ethernet_address_get(struct ecm_db_iface_instance *ii, uint8_t *address); |
Gareth Williams | 83125b1 | 2014-05-26 19:58:09 +0100 | [diff] [blame] | 138 | void ecm_db_iface_bridge_address_get(struct ecm_db_iface_instance *ii, uint8_t *address); |
ratheesh kannoth | a32fdd1 | 2015-09-09 08:02:58 +0530 | [diff] [blame] | 139 | #ifdef ECM_INTERFACE_PPPOE_ENABLE |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 140 | void ecm_db_iface_pppoe_session_info_get(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_pppoe *pppoe_info); |
Murat Sezgin | aad635c | 2015-03-06 16:11:41 -0800 | [diff] [blame] | 141 | #endif |
Murat Sezgin | 37fb395 | 2015-03-10 16:45:13 -0700 | [diff] [blame] | 142 | #ifdef ECM_INTERFACE_VLAN_ENABLE |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 143 | void ecm_db_iface_vlan_info_get(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_vlan *vlan_info); |
Murat Sezgin | 37fb395 | 2015-03-10 16:45:13 -0700 | [diff] [blame] | 144 | #endif |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 145 | |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 146 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_by_interface_identifier(int32_t interface_id); |
Tushar Mathur | 4ab0bf9 | 2014-06-10 20:37:07 +0530 | [diff] [blame] | 147 | struct ecm_db_iface_instance *ecm_db_iface_ifidx_find_and_ref_ethernet(uint8_t *address, int32_t idx); |
Murat Sezgin | 910c966 | 2015-03-11 16:15:06 -0700 | [diff] [blame] | 148 | #ifdef ECM_INTERFACE_BOND_ENABLE |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 149 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_lag(uint8_t *address); |
Murat Sezgin | 910c966 | 2015-03-11 16:15:06 -0700 | [diff] [blame] | 150 | #endif |
Murat Sezgin | 37fb395 | 2015-03-10 16:45:13 -0700 | [diff] [blame] | 151 | #ifdef ECM_INTERFACE_VLAN_ENABLE |
Radha krishna Simha Jiguru | f7dc34c | 2014-05-12 18:59:07 +0530 | [diff] [blame] | 152 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_vlan(uint8_t *address, uint16_t vlan_tag, uint16_t vlan_tpid); |
Murat Sezgin | 37fb395 | 2015-03-10 16:45:13 -0700 | [diff] [blame] | 153 | #endif |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 154 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_bridge(uint8_t *address); |
| 155 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_unknown(uint32_t os_specific_ident); |
ratheesh kannoth | a32fdd1 | 2015-09-09 08:02:58 +0530 | [diff] [blame] | 156 | #ifdef ECM_INTERFACE_PPPOE_ENABLE |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 157 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_pppoe(uint16_t pppoe_session_id, uint8_t *remote_mac); |
Murat Sezgin | aad635c | 2015-03-06 16:11:41 -0800 | [diff] [blame] | 158 | #endif |
ratheesh kannoth | ed72185 | 2015-09-28 12:39:52 +0530 | [diff] [blame] | 159 | void ecm_db_iface_update_ae_interface_identifier(struct ecm_db_iface_instance *ii, int32_t ae_interface_identifier); |
ratheesh kannoth | a32fdd1 | 2015-09-09 08:02:58 +0530 | [diff] [blame] | 160 | #ifdef ECM_INTERFACE_L2TPV2_ENABLE |
| 161 | void ecm_db_iface_pppol2tpv2_session_info_get(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_pppol2tpv2 *pppol2tpv2_info); |
| 162 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_pppol2tpv2(uint32_t pppol2tpv2_tunnel_id, uint32_t pppol2tpv2_session_id); |
| 163 | #endif |
ratheesh kannoth | cfdcb33 | 2015-12-24 07:19:18 +0530 | [diff] [blame] | 164 | #ifdef ECM_INTERFACE_MAP_T_ENABLE |
| 165 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_map_t(int if_index); |
| 166 | #endif |
Shyam Sunder | 23f2e54 | 2015-09-28 14:56:49 +0530 | [diff] [blame] | 167 | #ifdef ECM_INTERFACE_PPTP_ENABLE |
| 168 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_pptp(uint32_t pptp_src_call_id, uint32_t pptp_dst_call_id); |
| 169 | void ecm_db_iface_pptp_session_info_get(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_pptp *pptp_info); |
| 170 | #endif |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 171 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_loopback(uint32_t os_specific_ident); |
Murat Sezgin | 69a2753 | 2015-03-12 14:09:40 -0700 | [diff] [blame] | 172 | #ifdef ECM_INTERFACE_IPSEC_ENABLE |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 173 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_ipsec_tunnel(uint32_t os_specific_ident); |
Murat Sezgin | 69a2753 | 2015-03-12 14:09:40 -0700 | [diff] [blame] | 174 | #endif |
Murat Sezgin | bde55f9 | 2015-03-11 16:44:11 -0700 | [diff] [blame] | 175 | #ifdef ECM_INTERFACE_SIT_ENABLE |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 176 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_sit(ip_addr_t saddr, ip_addr_t daddr); |
Murat Sezgin | bde55f9 | 2015-03-11 16:44:11 -0700 | [diff] [blame] | 177 | #endif |
Murat Sezgin | c140256 | 2015-03-12 12:32:20 -0700 | [diff] [blame] | 178 | #ifdef ECM_INTERFACE_TUNIPIP6_ENABLE |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 179 | struct ecm_db_iface_instance *ecm_db_iface_find_and_ref_tunipip6(ip_addr_t saddr, ip_addr_t daddr); |
Murat Sezgin | c140256 | 2015-03-12 12:32:20 -0700 | [diff] [blame] | 180 | #endif |
Murat Sezgin | a5f3de1 | 2016-08-02 17:29:30 -0700 | [diff] [blame] | 181 | struct ecm_db_node_instance *ecm_db_node_find_and_ref(uint8_t *address, struct ecm_db_iface_instance *ii); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 182 | |
| 183 | void ecm_db_connection_from_interfaces_reset(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[], int32_t new_first); |
| 184 | void ecm_db_connection_to_interfaces_reset(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[], int32_t new_first); |
| 185 | void ecm_db_connection_from_nat_interfaces_reset(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[], int32_t new_first); |
| 186 | void ecm_db_connection_to_nat_interfaces_reset(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[], int32_t new_first); |
| 187 | |
| 188 | void ecm_db_connection_from_interfaces_clear(struct ecm_db_connection_instance *ci); |
| 189 | void ecm_db_connection_from_nat_interfaces_clear(struct ecm_db_connection_instance *ci); |
| 190 | void ecm_db_connection_to_interfaces_clear(struct ecm_db_connection_instance *ci); |
| 191 | void ecm_db_connection_to_nat_interfaces_clear(struct ecm_db_connection_instance *ci); |
| 192 | |
| 193 | bool ecm_db_connection_to_interfaces_set_check(struct ecm_db_connection_instance *ci); |
| 194 | bool ecm_db_connection_from_interfaces_set_check(struct ecm_db_connection_instance *ci); |
| 195 | bool ecm_db_connection_to_nat_interfaces_set_check(struct ecm_db_connection_instance *ci); |
| 196 | bool ecm_db_connection_from_nat_interfaces_set_check(struct ecm_db_connection_instance *ci); |
| 197 | |
| 198 | int32_t ecm_db_connection_to_nat_interfaces_get_count(struct ecm_db_connection_instance *ci); |
| 199 | int32_t ecm_db_connection_from_nat_interfaces_get_count(struct ecm_db_connection_instance *ci); |
| 200 | int32_t ecm_db_connection_to_interfaces_get_count(struct ecm_db_connection_instance *ci); |
| 201 | int32_t ecm_db_connection_from_interfaces_get_count(struct ecm_db_connection_instance *ci); |
| 202 | |
| 203 | int32_t ecm_db_connection_from_interfaces_get_and_ref(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[]); |
| 204 | int32_t ecm_db_connection_to_interfaces_get_and_ref(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[]); |
| 205 | int32_t ecm_db_connection_from_nat_interfaces_get_and_ref(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[]); |
| 206 | int32_t ecm_db_connection_to_nat_interfaces_get_and_ref(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces[]); |
| 207 | void ecm_db_connection_interfaces_deref(struct ecm_db_iface_instance *interfaces[], int32_t first); |
| 208 | |
Gareth Williams | f98d419 | 2015-03-11 16:55:41 +0000 | [diff] [blame] | 209 | struct ecm_db_connection_instance *ecm_db_connections_get_and_ref_first(void); |
| 210 | struct ecm_db_connection_instance *ecm_db_connection_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 211 | |
| 212 | struct ecm_db_mapping_instance *ecm_db_mappings_get_and_ref_first(void); |
| 213 | struct ecm_db_mapping_instance *ecm_db_mapping_get_and_ref_next(struct ecm_db_mapping_instance *mi); |
| 214 | |
| 215 | struct ecm_db_host_instance *ecm_db_hosts_get_and_ref_first(void); |
| 216 | struct ecm_db_host_instance *ecm_db_host_get_and_ref_next(struct ecm_db_host_instance *hi); |
| 217 | |
Murat Sezgin | a5f3de1 | 2016-08-02 17:29:30 -0700 | [diff] [blame] | 218 | bool ecm_db_node_is_mac_addr_equal(struct ecm_db_node_instance *ni, uint8_t *address); |
Gareth Williams | f98d419 | 2015-03-11 16:55:41 +0000 | [diff] [blame] | 219 | struct ecm_db_node_instance *ecm_db_nodes_get_and_ref_first(void); |
| 220 | struct ecm_db_node_instance *ecm_db_node_get_and_ref_next(struct ecm_db_node_instance *ni); |
Murat Sezgin | a5f3de1 | 2016-08-02 17:29:30 -0700 | [diff] [blame] | 221 | struct ecm_db_node_instance *ecm_db_node_chain_get_and_ref_first(uint8_t *address); |
| 222 | struct ecm_db_node_instance *ecm_db_node_chain_get_and_ref_next(struct ecm_db_node_instance *ni); |
Gareth Williams | f98d419 | 2015-03-11 16:55:41 +0000 | [diff] [blame] | 223 | |
| 224 | struct ecm_db_iface_instance *ecm_db_interfaces_get_and_ref_first(void); |
| 225 | struct ecm_db_iface_instance *ecm_db_interface_get_and_ref_next(struct ecm_db_iface_instance *ii); |
| 226 | |
Gareth Williams | b590389 | 2015-03-20 15:13:07 +0000 | [diff] [blame] | 227 | #ifdef ECM_DB_XREF_ENABLE |
| 228 | int ecm_db_host_mapping_count_get(struct ecm_db_host_instance *hi); |
| 229 | int ecm_db_iface_node_count_get(struct ecm_db_iface_instance *ii); |
| 230 | |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 231 | struct ecm_db_connection_instance *ecm_db_mapping_connections_from_get_and_ref_first(struct ecm_db_mapping_instance *mi); |
| 232 | struct ecm_db_connection_instance *ecm_db_mapping_connections_to_get_and_ref_first(struct ecm_db_mapping_instance *mi); |
| 233 | struct ecm_db_connection_instance *ecm_db_connection_mapping_from_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 234 | struct ecm_db_connection_instance *ecm_db_connection_mapping_to_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 235 | |
| 236 | struct ecm_db_connection_instance *ecm_db_mapping_connections_nat_from_get_and_ref_first(struct ecm_db_mapping_instance *mi); |
| 237 | struct ecm_db_connection_instance *ecm_db_mapping_connections_nat_to_get_and_ref_first(struct ecm_db_mapping_instance *mi); |
| 238 | struct ecm_db_connection_instance *ecm_db_connection_mapping_nat_from_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 239 | struct ecm_db_connection_instance *ecm_db_connection_mapping_nat_to_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 240 | |
| 241 | struct ecm_db_connection_instance *ecm_db_iface_connections_from_get_and_ref_first(struct ecm_db_iface_instance *ii); |
| 242 | struct ecm_db_connection_instance *ecm_db_iface_connections_to_get_and_ref_first(struct ecm_db_iface_instance *ii); |
| 243 | struct ecm_db_connection_instance *ecm_db_connection_iface_from_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 244 | struct ecm_db_connection_instance *ecm_db_connection_iface_to_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 245 | |
| 246 | struct ecm_db_connection_instance *ecm_db_iface_connections_nat_from_get_and_ref_first(struct ecm_db_iface_instance *ii); |
| 247 | struct ecm_db_connection_instance *ecm_db_iface_connections_nat_to_get_and_ref_first(struct ecm_db_iface_instance *ii); |
| 248 | struct ecm_db_connection_instance *ecm_db_connection_iface_nat_from_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 249 | struct ecm_db_connection_instance *ecm_db_connection_iface_nat_to_get_and_ref_next(struct ecm_db_connection_instance *ci); |
| 250 | |
| 251 | struct ecm_db_node_instance *ecm_db_iface_nodes_get_and_ref_first(struct ecm_db_iface_instance *ii); |
Gareth Williams | b590389 | 2015-03-20 15:13:07 +0000 | [diff] [blame] | 252 | #endif |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 253 | |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 254 | void ecm_db_connection_classifier_assign(struct ecm_db_connection_instance *ci, struct ecm_classifier_instance *new_ca); |
| 255 | int ecm_db_connection_classifier_assignments_get_and_ref(struct ecm_db_connection_instance *ci, struct ecm_classifier_instance *assignments[]); |
| 256 | void ecm_db_connection_classifier_unassign(struct ecm_db_connection_instance *ci, struct ecm_classifier_instance *cci); |
| 257 | void ecm_db_connection_assignments_release(int assignment_count, struct ecm_classifier_instance *assignments[]); |
| 258 | struct ecm_classifier_instance *ecm_db_connection_assigned_classifier_find_and_ref(struct ecm_db_connection_instance *ci, ecm_classifier_type_t type); |
| 259 | |
Gareth Williams | b39e7c2 | 2015-03-25 10:15:33 +0000 | [diff] [blame] | 260 | #ifdef ECM_DB_CTA_TRACK_ENABLE |
Gareth Williams | f98d419 | 2015-03-11 16:55:41 +0000 | [diff] [blame] | 261 | struct ecm_db_connection_instance *ecm_db_connection_by_classifier_type_assignment_get_and_ref_first(ecm_classifier_type_t ca_type); |
| 262 | struct ecm_db_connection_instance *ecm_db_connection_by_classifier_type_assignment_get_and_ref_next(struct ecm_db_connection_instance *ci, ecm_classifier_type_t ca_type); |
| 263 | void ecm_db_connection_by_classifier_type_assignment_deref(struct ecm_db_connection_instance *ci, ecm_classifier_type_t ca_type); |
Gareth Williams | b39e7c2 | 2015-03-25 10:15:33 +0000 | [diff] [blame] | 264 | #endif |
Gareth Williams | f98d419 | 2015-03-11 16:55:41 +0000 | [diff] [blame] | 265 | |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 266 | struct ecm_db_listener_instance *ecm_db_listener_alloc(void); |
| 267 | struct ecm_db_connection_instance *ecm_db_connection_alloc(void); |
| 268 | struct ecm_db_host_instance *ecm_db_host_alloc(void); |
| 269 | struct ecm_db_mapping_instance *ecm_db_mapping_alloc(void); |
| 270 | struct ecm_db_node_instance *ecm_db_node_alloc(void); |
| 271 | struct ecm_db_iface_instance *ecm_db_iface_alloc(void); |
| 272 | |
| 273 | char *ecm_db_interface_type_to_string(ecm_db_iface_type_t type); |
| 274 | |
| 275 | void ecm_db_listener_add(struct ecm_db_listener_instance *li, ecm_db_iface_listener_added_callback_t iface_added, ecm_db_iface_listener_removed_callback_t iface_removed, ecm_db_node_listener_added_callback_t node_added, ecm_db_node_listener_removed_callback_t node_removed, ecm_db_host_listener_added_callback_t host_added, ecm_db_host_listener_removed_callback_t host_removed, ecm_db_mapping_listener_added_callback_t mapping_added, ecm_db_mapping_listener_removed_callback_t mapping_removed, ecm_db_connection_listener_added_callback_t connection_added, ecm_db_connection_listener_removed_callback_t connection_removed, ecm_db_listener_final_callback_t final, void *arg); |
| 276 | |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 277 | void ecm_db_iface_add_ethernet(struct ecm_db_iface_instance *ii, uint8_t *address, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | 910c966 | 2015-03-11 16:15:06 -0700 | [diff] [blame] | 278 | #ifdef ECM_INTERFACE_BOND_ENABLE |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 279 | void ecm_db_iface_add_lag(struct ecm_db_iface_instance *ii, uint8_t *address, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | 910c966 | 2015-03-11 16:15:06 -0700 | [diff] [blame] | 280 | #endif |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 281 | void ecm_db_iface_add_bridge(struct ecm_db_iface_instance *ii, uint8_t *address, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | 37fb395 | 2015-03-10 16:45:13 -0700 | [diff] [blame] | 282 | #ifdef ECM_INTERFACE_VLAN_ENABLE |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 283 | void ecm_db_iface_add_vlan(struct ecm_db_iface_instance *ii, uint8_t *address, uint16_t vlan_tag, uint16_t vlan_tpid, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | 37fb395 | 2015-03-10 16:45:13 -0700 | [diff] [blame] | 284 | #endif |
ratheesh kannoth | a32fdd1 | 2015-09-09 08:02:58 +0530 | [diff] [blame] | 285 | |
| 286 | #ifdef ECM_INTERFACE_PPPOE_ENABLE |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 287 | void ecm_db_iface_add_pppoe(struct ecm_db_iface_instance *ii, uint16_t pppoe_session_id, uint8_t *remote_mac, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | aad635c | 2015-03-06 16:11:41 -0800 | [diff] [blame] | 288 | #endif |
ratheesh kannoth | a32fdd1 | 2015-09-09 08:02:58 +0530 | [diff] [blame] | 289 | |
| 290 | #ifdef ECM_INTERFACE_L2TPV2_ENABLE |
| 291 | void ecm_db_iface_add_pppol2tpv2(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_pppol2tpv2 *pppol2tpv2_info, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
| 292 | #endif |
Shyam Sunder | 23f2e54 | 2015-09-28 14:56:49 +0530 | [diff] [blame] | 293 | |
| 294 | #ifdef ECM_INTERFACE_PPTP_ENABLE |
| 295 | void ecm_db_iface_add_pptp(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_pptp *pptp_info, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
| 296 | #endif |
| 297 | |
ratheesh kannoth | cfdcb33 | 2015-12-24 07:19:18 +0530 | [diff] [blame] | 298 | #ifdef ECM_INTERFACE_MAP_T_ENABLE |
| 299 | void ecm_db_iface_add_map_t(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_map_t *map_t_info, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
| 300 | #endif |
| 301 | |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 302 | void ecm_db_iface_add_unknown(struct ecm_db_iface_instance *ii, uint32_t os_specific_ident, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
| 303 | void ecm_db_iface_add_loopback(struct ecm_db_iface_instance *ii, uint32_t os_specific_ident, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | 69a2753 | 2015-03-12 14:09:40 -0700 | [diff] [blame] | 304 | #ifdef ECM_INTERFACE_IPSEC_ENABLE |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 305 | void ecm_db_iface_add_ipsec_tunnel(struct ecm_db_iface_instance *ii, uint32_t os_specific_ident, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | 69a2753 | 2015-03-12 14:09:40 -0700 | [diff] [blame] | 306 | #endif |
Murat Sezgin | bde55f9 | 2015-03-11 16:44:11 -0700 | [diff] [blame] | 307 | #ifdef ECM_INTERFACE_SIT_ENABLE |
Zhu Ken | 56477be | 2014-08-05 17:50:28 +0800 | [diff] [blame] | 308 | bool ecm_db_iface_sit_daddr_is_null(struct ecm_db_iface_instance *ii); |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 309 | void ecm_db_iface_add_sit(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_sit *type_info, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | bde55f9 | 2015-03-11 16:44:11 -0700 | [diff] [blame] | 310 | #endif |
Murat Sezgin | c140256 | 2015-03-12 12:32:20 -0700 | [diff] [blame] | 311 | #ifdef ECM_INTERFACE_TUNIPIP6_ENABLE |
Murat Sezgin | 91c5d71 | 2015-06-12 15:16:22 -0700 | [diff] [blame] | 312 | void ecm_db_iface_add_tunipip6(struct ecm_db_iface_instance *ii, struct ecm_db_interface_info_tunipip6 *type_info, char *name, int32_t mtu, int32_t interface_identifier, int32_t ae_interface_identifier, ecm_db_iface_final_callback_t final, void *arg); |
Murat Sezgin | c140256 | 2015-03-12 12:32:20 -0700 | [diff] [blame] | 313 | #endif |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 314 | void ecm_db_node_add(struct ecm_db_node_instance *ni, struct ecm_db_iface_instance *ii, uint8_t *address, ecm_db_node_final_callback_t final, void *arg); |
Gareth Williams | 90f2a28 | 2014-08-27 15:56:25 +0100 | [diff] [blame] | 315 | void ecm_db_host_add(struct ecm_db_host_instance *hi, ip_addr_t address, bool on_link, ecm_db_host_final_callback_t final, void *arg); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 316 | void ecm_db_mapping_add(struct ecm_db_mapping_instance *mi, struct ecm_db_host_instance *hi, int port, ecm_db_mapping_final_callback_t final, void *arg); |
Murat Sezgin | fdb595e | 2016-05-10 11:27:37 -0700 | [diff] [blame] | 317 | void ecm_db_connection_add(struct ecm_db_connection_instance *ci, struct ecm_db_mapping_instance *mapping_from, struct ecm_db_mapping_instance *mapping_to, struct ecm_db_mapping_instance *mapping_nat_from, struct ecm_db_mapping_instance *mapping_nat_to, struct ecm_db_node_instance *from_node, struct ecm_db_node_instance *to_node, struct ecm_db_node_instance *from_nat_node, struct ecm_db_node_instance *to_nat_node, int ip_version, int protocol, ecm_db_direction_t dir, ecm_db_connection_final_callback_t final, ecm_db_connection_defunct_callback_t defunct, ecm_db_timer_group_t tg, bool is_routed, void *arg); |
Ben Menchaca | 84f3663 | 2014-02-28 20:57:38 +0000 | [diff] [blame] | 318 | |
| 319 | void ecm_db_listener_ref(struct ecm_db_listener_instance *li); |
| 320 | void ecm_db_connection_ref(struct ecm_db_connection_instance *ci); |
| 321 | void ecm_db_host_ref(struct ecm_db_host_instance *hi); |
| 322 | void ecm_db_mapping_ref(struct ecm_db_mapping_instance *mi); |
| 323 | void ecm_db_iface_ref(struct ecm_db_iface_instance *ii); |
| 324 | void ecm_db_node_ref(struct ecm_db_node_instance *ni); |
| 325 | |
| 326 | int ecm_db_listener_deref(struct ecm_db_listener_instance *li); |
| 327 | int ecm_db_connection_deref(struct ecm_db_connection_instance *ci); |
| 328 | int ecm_db_host_deref(struct ecm_db_host_instance *hi); |
| 329 | int ecm_db_mapping_deref(struct ecm_db_mapping_instance *mi); |
| 330 | int ecm_db_iface_deref(struct ecm_db_iface_instance *ii); |
| 331 | int ecm_db_node_deref(struct ecm_db_node_instance *ni); |
| 332 | |
Gareth Williams | f98d419 | 2015-03-11 16:55:41 +0000 | [diff] [blame] | 333 | int ecm_db_connection_count_by_protocol_get(int protocol); |
| 334 | |
| 335 | #ifdef ECM_STATE_OUTPUT_ENABLE |
Gareth Williams | d5618a8 | 2015-05-20 11:13:32 +0100 | [diff] [blame] | 336 | int ecm_db_connection_state_get(struct ecm_state_file_instance *sfi, struct ecm_db_connection_instance *ci); |
| 337 | int ecm_db_mapping_state_get(struct ecm_state_file_instance *sfi, struct ecm_db_mapping_instance *mi); |
| 338 | int ecm_db_host_state_get(struct ecm_state_file_instance *sfi, struct ecm_db_host_instance *hi); |
| 339 | int ecm_db_node_state_get(struct ecm_state_file_instance *sfi, struct ecm_db_node_instance *ni); |
| 340 | int ecm_db_iface_state_get(struct ecm_state_file_instance *sfi, struct ecm_db_iface_instance *ii); |
Gareth Williams | f98d419 | 2015-03-11 16:55:41 +0000 | [diff] [blame] | 341 | int ecm_db_connection_hash_table_lengths_get(int index); |
| 342 | int ecm_db_connection_hash_index_get_next(int index); |
| 343 | int ecm_db_connection_hash_index_get_first(void); |
| 344 | int ecm_db_mapping_hash_table_lengths_get(int index); |
| 345 | int ecm_db_mapping_hash_index_get_next(int index); |
| 346 | int ecm_db_mapping_hash_index_get_first(void); |
| 347 | int ecm_db_host_hash_table_lengths_get(int index); |
| 348 | int ecm_db_host_hash_index_get_next(int index); |
| 349 | int ecm_db_host_hash_index_get_first(void); |
| 350 | int ecm_db_node_hash_table_lengths_get(int index); |
| 351 | int ecm_db_node_hash_index_get_next(int index); |
| 352 | int ecm_db_node_hash_index_get_first(void); |
| 353 | int ecm_db_iface_hash_table_lengths_get(int index); |
| 354 | int ecm_db_iface_hash_index_get_next(int index); |
| 355 | int ecm_db_iface_hash_index_get_first(void); |
| 356 | int ecm_db_protocol_get_next(int protocol); |
| 357 | int ecm_db_protocol_get_first(void); |
| 358 | #endif |
Shyam Sunder | 1f03726 | 2015-05-18 20:04:13 +0530 | [diff] [blame] | 359 | |
| 360 | #ifdef ECM_MULTICAST_ENABLE |
| 361 | struct ecm_db_multicast_tuple_instance *ecm_db_multicast_tuple_instance_alloc(ip_addr_t origin, ip_addr_t group, uint16_t src_port, uint16_t dst_port); |
| 362 | int ecm_db_multicast_tuple_instance_deref(struct ecm_db_multicast_tuple_instance *ti); |
Shyam Sunder | 3af86a5 | 2015-08-28 18:04:10 +0530 | [diff] [blame] | 363 | void ecm_db_multicast_connection_deref(struct ecm_db_multicast_tuple_instance *ti); |
Shyam Sunder | bf40d0e | 2015-06-23 15:56:37 +0530 | [diff] [blame] | 364 | void ecm_db_multicast_tuple_instance_add(struct ecm_db_multicast_tuple_instance *ti, struct ecm_db_connection_instance *ci); |
Shyam Sunder | 3af86a5 | 2015-08-28 18:04:10 +0530 | [diff] [blame] | 365 | struct ecm_db_multicast_tuple_instance *ecm_db_multicast_connection_find_and_ref(ip_addr_t origin, ip_addr_t group); |
| 366 | struct ecm_db_multicast_tuple_instance *ecm_db_multicast_connection_get_and_ref_first(ip_addr_t group); |
| 367 | struct ecm_db_multicast_tuple_instance *ecm_db_multicast_connection_get_and_ref_next(struct ecm_db_multicast_tuple_instance *ti); |
Shyam Sunder | 1f03726 | 2015-05-18 20:04:13 +0530 | [diff] [blame] | 368 | void ecm_db_multicast_tuple_instance_source_ip_get(struct ecm_db_multicast_tuple_instance *ti, ip_addr_t origin); |
Shyam Sunder | f34c25b | 2015-06-11 21:14:50 +0530 | [diff] [blame] | 369 | void ecm_db_multicast_tuple_instance_group_ip_get(struct ecm_db_multicast_tuple_instance *ti, ip_addr_t group); |
Shyam Sunder | 1f03726 | 2015-05-18 20:04:13 +0530 | [diff] [blame] | 370 | uint32_t ecm_db_multicast_tuple_instance_flags_get(struct ecm_db_multicast_tuple_instance *ti); |
| 371 | void ecm_db_multicast_tuple_instance_flags_set(struct ecm_db_multicast_tuple_instance *ti, uint32_t flags); |
| 372 | void ecm_db_multicast_tuple_instance_flags_clear(struct ecm_db_multicast_tuple_instance *ti, uint32_t flags); |
| 373 | |
Shyam Sunder | 3af86a5 | 2015-08-28 18:04:10 +0530 | [diff] [blame] | 374 | struct ecm_db_connection_instance *ecm_db_multicast_connection_get_from_tuple(struct ecm_db_multicast_tuple_instance *ti); |
Shyam Sunder | 1f03726 | 2015-05-18 20:04:13 +0530 | [diff] [blame] | 375 | void ecm_db_multicast_connection_to_interfaces_deref_all(struct ecm_db_iface_instance *interfaces, int32_t *ifaces_first); |
| 376 | void ecm_db_multicast_connection_to_interfaces_clear(struct ecm_db_connection_instance *ci); |
| 377 | int32_t ecm_db_multicast_connection_to_interfaces_get_and_ref_all(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance **interfaces, int32_t **to_ifaces_first); |
Shyam Sunder | bf40d0e | 2015-06-23 15:56:37 +0530 | [diff] [blame] | 378 | int ecm_db_multicast_connection_to_interfaces_reset(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces, int32_t *new_first); |
Shyam Sunder | 1f03726 | 2015-05-18 20:04:13 +0530 | [diff] [blame] | 379 | void ecm_db_multicast_connection_to_interfaces_update(struct ecm_db_connection_instance *ci, struct ecm_db_iface_instance *interfaces, int32_t *new_first, int *join_valid_idx); |
| 380 | void ecm_db_multicast_connection_data_totals_update(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets); |
| 381 | void ecm_db_multicast_connection_to_interfaces_clear_at_index(struct ecm_db_connection_instance *ci, uint32_t index); |
Shyam Sunder | 3b049ff | 2015-05-18 20:44:30 +0530 | [diff] [blame] | 382 | void ecm_db_multicast_connection_data_totals_update(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets); |
| 383 | void ecm_db_multicast_connection_interface_heirarchy_stats_update(struct ecm_db_connection_instance *ci, uint64_t size, uint64_t packets); |
Shyam Sunder | 1f03726 | 2015-05-18 20:04:13 +0530 | [diff] [blame] | 384 | bool ecm_db_multicast_connection_to_interfaces_set_check(struct ecm_db_connection_instance *ci); |
| 385 | #endif |
ratheesh kannoth | 37e35b0 | 2015-03-26 11:25:02 +0530 | [diff] [blame] | 386 | #endif |