Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/ip_fw_table.h
| Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | |||||
| MALLOC_DECLARE(M_IPFW_TBL); | MALLOC_DECLARE(M_IPFW_TBL); | ||||
| /* Exported to support legacy opcodes */ | /* Exported to support legacy opcodes */ | ||||
| int add_table_entry(struct ip_fw_chain *ch, struct tid_info *ti, | int add_table_entry(struct ip_fw_chain *ch, struct tid_info *ti, | ||||
| struct tentry_info *tei, uint8_t flags, uint32_t count); | struct tentry_info *tei, uint8_t flags, uint32_t count); | ||||
| int del_table_entry(struct ip_fw_chain *ch, struct tid_info *ti, | int del_table_entry(struct ip_fw_chain *ch, struct tid_info *ti, | ||||
| struct tentry_info *tei, uint8_t flags, uint32_t count); | struct tentry_info *tei, uint8_t flags, uint32_t count); | ||||
| int flush_table(struct ip_fw_chain *ch, struct tid_info *ti); | int flush_table(struct ip_fw_chain *ch, struct tid_info *ti); | ||||
| void ipfw_import_table_value_legacy(uint32_t value, struct table_value *v); | |||||
| uint32_t ipfw_export_table_value_legacy(struct table_value *v); | |||||
| int ipfw_get_table_size(struct ip_fw_chain *ch, ip_fw3_opheader *op3, | |||||
| struct sockopt_data *sd); | |||||
| /* ipfw_table_value.c functions */ | /* ipfw_table_value.c functions */ | ||||
| struct table_config; | struct table_config; | ||||
| struct tableop_state; | struct tableop_state; | ||||
| void ipfw_table_value_init(struct ip_fw_chain *ch, int first); | void ipfw_table_value_init(struct ip_fw_chain *ch, int first); | ||||
| void ipfw_table_value_destroy(struct ip_fw_chain *ch, int last); | void ipfw_table_value_destroy(struct ip_fw_chain *ch, int last); | ||||
| int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, | int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, | ||||
| uint8_t flags); | uint8_t flags); | ||||
| void ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc, | void ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc, | ||||
| struct tentry_info *tei, uint32_t count, int rollback); | struct tentry_info *tei, uint32_t count, int rollback); | ||||
| void ipfw_import_table_value_v1(ipfw_table_value *iv); | void ipfw_import_table_value_v1(ipfw_table_value *iv); | ||||
| void ipfw_export_table_value_v1(struct table_value *v, ipfw_table_value *iv); | void ipfw_export_table_value_v1(struct table_value *v, ipfw_table_value *iv); | ||||
| void ipfw_unref_table_values(struct ip_fw_chain *ch, struct table_config *tc, | void ipfw_unref_table_values(struct ip_fw_chain *ch, struct table_config *tc, | ||||
| struct table_algo *ta, void *astate, struct table_info *ti); | struct table_algo *ta, void *astate, struct table_info *ti); | ||||
| void rollback_table_values(struct tableop_state *ts); | void rollback_table_values(struct tableop_state *ts); | ||||
| int ipfw_rewrite_table_uidx(struct ip_fw_chain *chain, | int ipfw_rewrite_table_uidx(struct ip_fw_chain *chain, | ||||
| struct rule_check_info *ci); | struct rule_check_info *ci); | ||||
| int ipfw_mark_table_kidx(struct ip_fw_chain *chain, struct ip_fw *rule, | int ipfw_mark_table_kidx(struct ip_fw_chain *chain, struct ip_fw *rule, | ||||
| uint32_t *bmask); | uint32_t *bmask); | ||||
| int ipfw_export_table_ntlv(struct ip_fw_chain *ch, uint16_t kidx, | int ipfw_export_table_ntlv(struct ip_fw_chain *ch, uint32_t kidx, | ||||
| struct sockopt_data *sd); | struct sockopt_data *sd); | ||||
| void ipfw_unref_rule_tables(struct ip_fw_chain *chain, struct ip_fw *rule); | void ipfw_unref_rule_tables(struct ip_fw_chain *chain, struct ip_fw *rule); | ||||
| struct namedobj_instance *ipfw_get_table_objhash(struct ip_fw_chain *ch); | struct namedobj_instance *ipfw_get_table_objhash(struct ip_fw_chain *ch); | ||||
| /* utility functions */ | /* utility functions */ | ||||
| int ipfw_move_tables_sets(struct ip_fw_chain *ch, ipfw_range_tlv *rt, | int ipfw_move_tables_sets(struct ip_fw_chain *ch, ipfw_range_tlv *rt, | ||||
| uint32_t new_set); | uint32_t new_set); | ||||
| void ipfw_swap_tables_sets(struct ip_fw_chain *ch, uint32_t old_set, | void ipfw_swap_tables_sets(struct ip_fw_chain *ch, uint32_t old_set, | ||||
| uint32_t new_set, int mv); | uint32_t new_set, int mv); | ||||
| int ipfw_foreach_table_tentry(struct ip_fw_chain *ch, uint16_t kidx, | int ipfw_foreach_table_tentry(struct ip_fw_chain *ch, uint32_t kidx, | ||||
| ta_foreach_f f, void *arg); | ta_foreach_f f, void *arg); | ||||
| /* internal functions */ | /* internal functions */ | ||||
| void tc_ref(struct table_config *tc); | void tc_ref(struct table_config *tc); | ||||
| void tc_unref(struct table_config *tc); | void tc_unref(struct table_config *tc); | ||||
| struct op_state; | struct op_state; | ||||
| typedef void (op_rollback_f)(void *object, struct op_state *state); | typedef void (op_rollback_f)(void *object, struct op_state *state); | ||||
| Show All 12 Lines | struct tableop_state { | ||||
| uint32_t vmask; | uint32_t vmask; | ||||
| int vshared; | int vshared; | ||||
| int modified; | int modified; | ||||
| }; | }; | ||||
| void add_toperation_state(struct ip_fw_chain *ch, struct tableop_state *ts); | void add_toperation_state(struct ip_fw_chain *ch, struct tableop_state *ts); | ||||
| void del_toperation_state(struct ip_fw_chain *ch, struct tableop_state *ts); | void del_toperation_state(struct ip_fw_chain *ch, struct tableop_state *ts); | ||||
| void rollback_toperation_state(struct ip_fw_chain *ch, void *object); | void rollback_toperation_state(struct ip_fw_chain *ch, void *object); | ||||
| /* Legacy interfaces */ | |||||
| int ipfw_count_table(struct ip_fw_chain *ch, struct tid_info *ti, | |||||
| uint32_t *cnt); | |||||
| int ipfw_count_xtable(struct ip_fw_chain *ch, struct tid_info *ti, | |||||
| uint32_t *cnt); | |||||
| int ipfw_dump_table_legacy(struct ip_fw_chain *ch, struct tid_info *ti, | |||||
| ipfw_table *tbl); | |||||
| #endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
| #endif /* _IPFW2_TABLE_H */ | #endif /* _IPFW2_TABLE_H */ | ||||