mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 07:37:29 +00:00
zebra: Remove _wrap_script from hook names
The _wrap_script inclusion implies a certain end functionality of which we don't care. We just care that the hooks are called. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
62f20a52ab
commit
1c6fca1f62
@ -103,23 +103,23 @@ static const struct message fragment_value_str[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* static function declarations */
|
/* static function declarations */
|
||||||
DEFINE_HOOK(zebra_pbr_ipset_entry_wrap_script_get_stat,
|
DEFINE_HOOK(zebra_pbr_ipset_entry_get_stat,
|
||||||
(struct zebra_pbr_ipset_entry *ipset, uint64_t *pkts,
|
(struct zebra_pbr_ipset_entry *ipset, uint64_t *pkts,
|
||||||
uint64_t *bytes),
|
uint64_t *bytes),
|
||||||
(ipset, pkts, bytes))
|
(ipset, pkts, bytes))
|
||||||
|
|
||||||
DEFINE_HOOK(zebra_pbr_iptable_wrap_script_get_stat,
|
DEFINE_HOOK(zebra_pbr_iptable_get_stat,
|
||||||
(struct zebra_pbr_iptable *iptable, uint64_t *pkts,
|
(struct zebra_pbr_iptable *iptable, uint64_t *pkts,
|
||||||
uint64_t *bytes),
|
uint64_t *bytes),
|
||||||
(iptable, pkts, bytes))
|
(iptable, pkts, bytes))
|
||||||
|
|
||||||
DEFINE_HOOK(zebra_pbr_iptable_wrap_script_update,
|
DEFINE_HOOK(zebra_pbr_iptable_update,
|
||||||
(int cmd, struct zebra_pbr_iptable *iptable), (cmd, iptable));
|
(int cmd, struct zebra_pbr_iptable *iptable), (cmd, iptable));
|
||||||
|
|
||||||
DEFINE_HOOK(zebra_pbr_ipset_entry_wrap_script_update,
|
DEFINE_HOOK(zebra_pbr_ipset_entry_update,
|
||||||
(int cmd, struct zebra_pbr_ipset_entry *ipset), (cmd, ipset));
|
(int cmd, struct zebra_pbr_ipset_entry *ipset), (cmd, ipset));
|
||||||
|
|
||||||
DEFINE_HOOK(zebra_pbr_ipset_wrap_script_update,
|
DEFINE_HOOK(zebra_pbr_ipset_update,
|
||||||
(int cmd, struct zebra_pbr_ipset *ipset), (cmd, ipset));
|
(int cmd, struct zebra_pbr_ipset *ipset), (cmd, ipset));
|
||||||
|
|
||||||
/* Private functions */
|
/* Private functions */
|
||||||
@ -246,7 +246,7 @@ void zebra_pbr_ipset_free(void *arg)
|
|||||||
struct zebra_pbr_ipset *ipset;
|
struct zebra_pbr_ipset *ipset;
|
||||||
|
|
||||||
ipset = (struct zebra_pbr_ipset *)arg;
|
ipset = (struct zebra_pbr_ipset *)arg;
|
||||||
hook_call(zebra_pbr_ipset_wrap_script_update, 0, ipset);
|
hook_call(zebra_pbr_ipset_update, 0, ipset);
|
||||||
XFREE(MTYPE_TMP, ipset);
|
XFREE(MTYPE_TMP, ipset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ void zebra_pbr_ipset_entry_free(void *arg)
|
|||||||
|
|
||||||
ipset = (struct zebra_pbr_ipset_entry *)arg;
|
ipset = (struct zebra_pbr_ipset_entry *)arg;
|
||||||
|
|
||||||
hook_call(zebra_pbr_ipset_entry_wrap_script_update, 0, ipset);
|
hook_call(zebra_pbr_ipset_entry_update, 0, ipset);
|
||||||
|
|
||||||
XFREE(MTYPE_TMP, ipset);
|
XFREE(MTYPE_TMP, ipset);
|
||||||
}
|
}
|
||||||
@ -348,7 +348,7 @@ void zebra_pbr_iptable_free(void *arg)
|
|||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
iptable = (struct zebra_pbr_iptable *)arg;
|
iptable = (struct zebra_pbr_iptable *)arg;
|
||||||
hook_call(zebra_pbr_iptable_wrap_script_update, 0, iptable);
|
hook_call(zebra_pbr_iptable_update, 0, iptable);
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(iptable->interface_name_list,
|
for (ALL_LIST_ELEMENTS(iptable->interface_name_list,
|
||||||
node, nnode, name)) {
|
node, nnode, name)) {
|
||||||
@ -479,7 +479,7 @@ static void zebra_pbr_cleanup_ipset(struct hash_backet *b, void *data)
|
|||||||
int *sock = data;
|
int *sock = data;
|
||||||
|
|
||||||
if (ipset->sock == *sock) {
|
if (ipset->sock == *sock) {
|
||||||
hook_call(zebra_pbr_ipset_wrap_script_update, 0, ipset);
|
hook_call(zebra_pbr_ipset_update, 0, ipset);
|
||||||
hash_release(zrouter.ipset_hash, ipset);
|
hash_release(zrouter.ipset_hash, ipset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -490,7 +490,7 @@ static void zebra_pbr_cleanup_ipset_entry(struct hash_backet *b, void *data)
|
|||||||
int *sock = data;
|
int *sock = data;
|
||||||
|
|
||||||
if (ipset->sock == *sock) {
|
if (ipset->sock == *sock) {
|
||||||
hook_call(zebra_pbr_ipset_entry_wrap_script_update, 0, ipset);
|
hook_call(zebra_pbr_ipset_entry_update, 0, ipset);
|
||||||
hash_release(zrouter.ipset_entry_hash, ipset);
|
hash_release(zrouter.ipset_entry_hash, ipset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -501,7 +501,7 @@ static void zebra_pbr_cleanup_iptable(struct hash_backet *b, void *data)
|
|||||||
int *sock = data;
|
int *sock = data;
|
||||||
|
|
||||||
if (iptable->sock == *sock) {
|
if (iptable->sock == *sock) {
|
||||||
hook_call(zebra_pbr_iptable_wrap_script_update, 0, iptable);
|
hook_call(zebra_pbr_iptable_update, 0, iptable);
|
||||||
hash_release(zrouter.iptable_hash, iptable);
|
hash_release(zrouter.iptable_hash, iptable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -544,7 +544,7 @@ void zebra_pbr_create_ipset(struct zebra_pbr_ipset *ipset)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
(void)hash_get(zrouter.ipset_hash, ipset, pbr_ipset_alloc_intern);
|
(void)hash_get(zrouter.ipset_hash, ipset, pbr_ipset_alloc_intern);
|
||||||
ret = hook_call(zebra_pbr_ipset_wrap_script_update, 1, ipset);
|
ret = hook_call(zebra_pbr_ipset_update, 1, ipset);
|
||||||
kernel_pbr_ipset_add_del_status(ipset,
|
kernel_pbr_ipset_add_del_status(ipset,
|
||||||
ret ? ZEBRA_DPLANE_INSTALL_SUCCESS
|
ret ? ZEBRA_DPLANE_INSTALL_SUCCESS
|
||||||
: ZEBRA_DPLANE_INSTALL_FAILURE);
|
: ZEBRA_DPLANE_INSTALL_FAILURE);
|
||||||
@ -555,7 +555,7 @@ void zebra_pbr_destroy_ipset(struct zebra_pbr_ipset *ipset)
|
|||||||
struct zebra_pbr_ipset *lookup;
|
struct zebra_pbr_ipset *lookup;
|
||||||
|
|
||||||
lookup = hash_lookup(zrouter.ipset_hash, ipset);
|
lookup = hash_lookup(zrouter.ipset_hash, ipset);
|
||||||
hook_call(zebra_pbr_ipset_wrap_script_update, 0, ipset);
|
hook_call(zebra_pbr_ipset_update, 0, ipset);
|
||||||
if (lookup) {
|
if (lookup) {
|
||||||
hash_release(zrouter.ipset_hash, lookup);
|
hash_release(zrouter.ipset_hash, lookup);
|
||||||
XFREE(MTYPE_TMP, lookup);
|
XFREE(MTYPE_TMP, lookup);
|
||||||
@ -624,7 +624,7 @@ void zebra_pbr_add_ipset_entry(struct zebra_pbr_ipset_entry *ipset)
|
|||||||
|
|
||||||
(void)hash_get(zrouter.ipset_entry_hash, ipset,
|
(void)hash_get(zrouter.ipset_entry_hash, ipset,
|
||||||
pbr_ipset_entry_alloc_intern);
|
pbr_ipset_entry_alloc_intern);
|
||||||
ret = hook_call(zebra_pbr_ipset_entry_wrap_script_update, 1, ipset);
|
ret = hook_call(zebra_pbr_ipset_entry_update, 1, ipset);
|
||||||
kernel_pbr_ipset_entry_add_del_status(ipset,
|
kernel_pbr_ipset_entry_add_del_status(ipset,
|
||||||
ret ? ZEBRA_DPLANE_INSTALL_SUCCESS
|
ret ? ZEBRA_DPLANE_INSTALL_SUCCESS
|
||||||
: ZEBRA_DPLANE_INSTALL_FAILURE);
|
: ZEBRA_DPLANE_INSTALL_FAILURE);
|
||||||
@ -635,7 +635,7 @@ void zebra_pbr_del_ipset_entry(struct zebra_pbr_ipset_entry *ipset)
|
|||||||
struct zebra_pbr_ipset_entry *lookup;
|
struct zebra_pbr_ipset_entry *lookup;
|
||||||
|
|
||||||
lookup = hash_lookup(zrouter.ipset_entry_hash, ipset);
|
lookup = hash_lookup(zrouter.ipset_entry_hash, ipset);
|
||||||
hook_call(zebra_pbr_ipset_entry_wrap_script_update, 0, ipset);
|
hook_call(zebra_pbr_ipset_entry_update, 0, ipset);
|
||||||
if (lookup) {
|
if (lookup) {
|
||||||
hash_release(zrouter.ipset_entry_hash, lookup);
|
hash_release(zrouter.ipset_entry_hash, lookup);
|
||||||
XFREE(MTYPE_TMP, lookup);
|
XFREE(MTYPE_TMP, lookup);
|
||||||
@ -663,7 +663,7 @@ void zebra_pbr_add_iptable(struct zebra_pbr_iptable *iptable)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
(void)hash_get(zrouter.iptable_hash, iptable, pbr_iptable_alloc_intern);
|
(void)hash_get(zrouter.iptable_hash, iptable, pbr_iptable_alloc_intern);
|
||||||
ret = hook_call(zebra_pbr_iptable_wrap_script_update, 1, iptable);
|
ret = hook_call(zebra_pbr_iptable_update, 1, iptable);
|
||||||
kernel_pbr_iptable_add_del_status(iptable,
|
kernel_pbr_iptable_add_del_status(iptable,
|
||||||
ret ? ZEBRA_DPLANE_INSTALL_SUCCESS
|
ret ? ZEBRA_DPLANE_INSTALL_SUCCESS
|
||||||
: ZEBRA_DPLANE_INSTALL_FAILURE);
|
: ZEBRA_DPLANE_INSTALL_FAILURE);
|
||||||
@ -674,7 +674,7 @@ void zebra_pbr_del_iptable(struct zebra_pbr_iptable *iptable)
|
|||||||
struct zebra_pbr_iptable *lookup;
|
struct zebra_pbr_iptable *lookup;
|
||||||
|
|
||||||
lookup = hash_lookup(zrouter.iptable_hash, iptable);
|
lookup = hash_lookup(zrouter.iptable_hash, iptable);
|
||||||
hook_call(zebra_pbr_iptable_wrap_script_update, 0, iptable);
|
hook_call(zebra_pbr_iptable_update, 0, iptable);
|
||||||
if (lookup) {
|
if (lookup) {
|
||||||
struct listnode *node, *nnode;
|
struct listnode *node, *nnode;
|
||||||
char *name;
|
char *name;
|
||||||
@ -941,7 +941,7 @@ static int zebra_pbr_show_ipset_entry_walkcb(struct hash_backet *backet,
|
|||||||
}
|
}
|
||||||
vty_out(vty, " (%u)\n", zpie->unique);
|
vty_out(vty, " (%u)\n", zpie->unique);
|
||||||
|
|
||||||
ret = hook_call(zebra_pbr_ipset_entry_wrap_script_get_stat, zpie, &pkts,
|
ret = hook_call(zebra_pbr_ipset_entry_get_stat, zpie, &pkts,
|
||||||
&bytes);
|
&bytes);
|
||||||
if (ret && pkts > 0)
|
if (ret && pkts > 0)
|
||||||
vty_out(vty, "\t pkts %" PRIu64 ", bytes %" PRIu64"\n",
|
vty_out(vty, "\t pkts %" PRIu64 ", bytes %" PRIu64"\n",
|
||||||
@ -1095,7 +1095,7 @@ static void zebra_pbr_show_iptable_unit(struct zebra_pbr_iptable *iptable,
|
|||||||
" not" : "", lookup_msg(fragment_value_str,
|
" not" : "", lookup_msg(fragment_value_str,
|
||||||
iptable->fragment, val_str));
|
iptable->fragment, val_str));
|
||||||
}
|
}
|
||||||
ret = hook_call(zebra_pbr_iptable_wrap_script_get_stat, iptable, &pkts,
|
ret = hook_call(zebra_pbr_iptable_get_stat, iptable, &pkts,
|
||||||
&bytes);
|
&bytes);
|
||||||
if (ret && pkts > 0)
|
if (ret && pkts > 0)
|
||||||
vty_out(vty, "\t pkts %" PRIu64 ", bytes %" PRIu64"\n",
|
vty_out(vty, "\t pkts %" PRIu64 ", bytes %" PRIu64"\n",
|
||||||
|
@ -236,20 +236,20 @@ extern void zebra_pbr_iptable_update_interfacelist(struct stream *s,
|
|||||||
size_t zebra_pbr_tcpflags_snprintf(char *buffer, size_t len,
|
size_t zebra_pbr_tcpflags_snprintf(char *buffer, size_t len,
|
||||||
uint16_t tcp_val);
|
uint16_t tcp_val);
|
||||||
|
|
||||||
DECLARE_HOOK(zebra_pbr_ipset_entry_wrap_script_get_stat,
|
DECLARE_HOOK(zebra_pbr_ipset_entry_get_stat,
|
||||||
(struct zebra_pbr_ipset_entry *ipset, uint64_t *pkts,
|
(struct zebra_pbr_ipset_entry *ipset, uint64_t *pkts,
|
||||||
uint64_t *bytes),
|
uint64_t *bytes),
|
||||||
(ipset, pkts, bytes))
|
(ipset, pkts, bytes))
|
||||||
DECLARE_HOOK(zebra_pbr_iptable_wrap_script_get_stat,
|
DECLARE_HOOK(zebra_pbr_iptable_get_stat,
|
||||||
(struct zebra_pbr_iptable *iptable, uint64_t *pkts,
|
(struct zebra_pbr_iptable *iptable, uint64_t *pkts,
|
||||||
uint64_t *bytes),
|
uint64_t *bytes),
|
||||||
(iptable, pkts, bytes))
|
(iptable, pkts, bytes))
|
||||||
DECLARE_HOOK(zebra_pbr_iptable_wrap_script_update,
|
DECLARE_HOOK(zebra_pbr_iptable_update,
|
||||||
(int cmd, struct zebra_pbr_iptable *iptable), (cmd, iptable));
|
(int cmd, struct zebra_pbr_iptable *iptable), (cmd, iptable));
|
||||||
|
|
||||||
DECLARE_HOOK(zebra_pbr_ipset_entry_wrap_script_update,
|
DECLARE_HOOK(zebra_pbr_ipset_entry_update,
|
||||||
(int cmd, struct zebra_pbr_ipset_entry *ipset), (cmd, ipset));
|
(int cmd, struct zebra_pbr_ipset_entry *ipset), (cmd, ipset));
|
||||||
DECLARE_HOOK(zebra_pbr_ipset_wrap_script_update,
|
DECLARE_HOOK(zebra_pbr_ipset_update,
|
||||||
(int cmd, struct zebra_pbr_ipset *ipset), (cmd, ipset));
|
(int cmd, struct zebra_pbr_ipset *ipset), (cmd, ipset));
|
||||||
|
|
||||||
#endif /* _ZEBRA_PBR_H */
|
#endif /* _ZEBRA_PBR_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user