mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 00:25:01 +00:00
nhrpd: Introduce new - nflog mutlicast-nflog-group (1-65535) - command
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
This commit is contained in:
parent
9f7f6d3c6b
commit
9084e20961
@ -13,6 +13,7 @@ union sockunion;
|
|||||||
struct interface;
|
struct interface;
|
||||||
|
|
||||||
extern int netlink_nflog_group;
|
extern int netlink_nflog_group;
|
||||||
|
extern int netlink_mcast_nflog_group;
|
||||||
extern int netlink_req_fd;
|
extern int netlink_req_fd;
|
||||||
|
|
||||||
void netlink_init(void);
|
void netlink_init(void);
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
DEFINE_MTYPE_STATIC(NHRPD, NHRP_MULTICAST, "NHRP Multicast")
|
DEFINE_MTYPE_STATIC(NHRPD, NHRP_MULTICAST, "NHRP Multicast")
|
||||||
|
|
||||||
static int netlink_mcast_nflog_group;
|
int netlink_mcast_nflog_group;
|
||||||
static int netlink_mcast_log_fd = -1;
|
static int netlink_mcast_log_fd = -1;
|
||||||
static struct thread *netlink_mcast_log_thread;
|
static struct thread *netlink_mcast_log_thread;
|
||||||
|
|
||||||
@ -201,15 +201,7 @@ static void netlink_mcast_log_register(int fd, int group)
|
|||||||
zbuf_free(zb);
|
zbuf_free(zb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nhrp_multicast_free(struct interface *ifp,
|
void netlink_mcast_set_nflog_group(int nlgroup)
|
||||||
struct nhrp_multicast *mcast)
|
|
||||||
{
|
|
||||||
list_del(&mcast->list_entry);
|
|
||||||
XFREE(MTYPE_NHRP_MULTICAST, mcast);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void netlink_mcast_set_nflog_group(struct interface *ifp, int nlgroup)
|
|
||||||
{
|
{
|
||||||
if (netlink_mcast_log_fd >= 0) {
|
if (netlink_mcast_log_fd >= 0) {
|
||||||
THREAD_OFF(netlink_mcast_log_thread);
|
THREAD_OFF(netlink_mcast_log_thread);
|
||||||
@ -232,6 +224,14 @@ static void netlink_mcast_set_nflog_group(struct interface *ifp, int nlgroup)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int nhrp_multicast_free(struct interface *ifp,
|
||||||
|
struct nhrp_multicast *mcast)
|
||||||
|
{
|
||||||
|
list_del(&mcast->list_entry);
|
||||||
|
XFREE(MTYPE_NHRP_MULTICAST, mcast);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int nhrp_multicast_add(struct interface *ifp, afi_t afi,
|
int nhrp_multicast_add(struct interface *ifp, afi_t afi,
|
||||||
union sockunion *nbma_addr)
|
union sockunion *nbma_addr)
|
||||||
{
|
{
|
||||||
@ -252,9 +252,6 @@ int nhrp_multicast_add(struct interface *ifp, afi_t afi,
|
|||||||
};
|
};
|
||||||
list_add_tail(&mcast->list_entry, &nifp->afi[afi].mcastlist_head);
|
list_add_tail(&mcast->list_entry, &nifp->afi[afi].mcastlist_head);
|
||||||
|
|
||||||
if (netlink_mcast_log_fd == -1)
|
|
||||||
netlink_mcast_set_nflog_group(ifp, MCAST_NFLOG_GROUP);
|
|
||||||
|
|
||||||
sockunion2str(nbma_addr, buf, sizeof(buf));
|
sockunion2str(nbma_addr, buf, sizeof(buf));
|
||||||
debugf(NHRP_DEBUG_COMMON, "Adding multicast entry (%s)", buf);
|
debugf(NHRP_DEBUG_COMMON, "Adding multicast entry (%s)", buf);
|
||||||
|
|
||||||
|
@ -187,6 +187,9 @@ static int nhrp_config_write(struct vty *vty)
|
|||||||
if (netlink_nflog_group) {
|
if (netlink_nflog_group) {
|
||||||
vty_out(vty, "nhrp nflog-group %d\n", netlink_nflog_group);
|
vty_out(vty, "nhrp nflog-group %d\n", netlink_nflog_group);
|
||||||
}
|
}
|
||||||
|
if (netlink_mcast_nflog_group)
|
||||||
|
vty_out(vty, "nhrp multicast-nflog-group %d\n",
|
||||||
|
netlink_mcast_nflog_group);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -257,6 +260,31 @@ DEFUN(no_nhrp_nflog_group, no_nhrp_nflog_group_cmd,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFUN(nhrp_multicast_nflog_group, nhrp_multicast_nflog_group_cmd,
|
||||||
|
"nhrp multicast-nflog-group (1-65535)",
|
||||||
|
NHRP_STR
|
||||||
|
"Specify NFLOG group number for Multicast Packets\n"
|
||||||
|
"NFLOG group number\n")
|
||||||
|
{
|
||||||
|
uint32_t nfgroup;
|
||||||
|
|
||||||
|
nfgroup = strtoul(argv[2]->arg, NULL, 10);
|
||||||
|
netlink_mcast_set_nflog_group(nfgroup);
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFUN(no_nhrp_multicast_nflog_group, no_nhrp_multicast_nflog_group_cmd,
|
||||||
|
"no nhrp multicast-nflog-group [(1-65535)]",
|
||||||
|
NO_STR
|
||||||
|
NHRP_STR
|
||||||
|
"Specify NFLOG group number\n"
|
||||||
|
"NFLOG group number\n")
|
||||||
|
{
|
||||||
|
netlink_mcast_set_nflog_group(0);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFUN(tunnel_protection, tunnel_protection_cmd,
|
DEFUN(tunnel_protection, tunnel_protection_cmd,
|
||||||
"tunnel protection vici profile PROFILE [fallback-profile FALLBACK]",
|
"tunnel protection vici profile PROFILE [fallback-profile FALLBACK]",
|
||||||
"NHRP/GRE integration\n"
|
"NHRP/GRE integration\n"
|
||||||
@ -1234,6 +1262,8 @@ void nhrp_config_init(void)
|
|||||||
install_element(CONFIG_NODE, &no_nhrp_event_socket_cmd);
|
install_element(CONFIG_NODE, &no_nhrp_event_socket_cmd);
|
||||||
install_element(CONFIG_NODE, &nhrp_nflog_group_cmd);
|
install_element(CONFIG_NODE, &nhrp_nflog_group_cmd);
|
||||||
install_element(CONFIG_NODE, &no_nhrp_nflog_group_cmd);
|
install_element(CONFIG_NODE, &no_nhrp_nflog_group_cmd);
|
||||||
|
install_element(CONFIG_NODE, &nhrp_multicast_nflog_group_cmd);
|
||||||
|
install_element(CONFIG_NODE, &no_nhrp_multicast_nflog_group_cmd);
|
||||||
|
|
||||||
/* interface specific commands */
|
/* interface specific commands */
|
||||||
install_node(&nhrp_interface_node);
|
install_node(&nhrp_interface_node);
|
||||||
|
@ -24,7 +24,6 @@ DECLARE_MGROUP(NHRPD);
|
|||||||
|
|
||||||
#define NHRP_VTY_PORT 2610
|
#define NHRP_VTY_PORT 2610
|
||||||
#define NHRP_DEFAULT_CONFIG "nhrpd.conf"
|
#define NHRP_DEFAULT_CONFIG "nhrpd.conf"
|
||||||
#define MCAST_NFLOG_GROUP 224
|
|
||||||
|
|
||||||
extern struct thread_master *master;
|
extern struct thread_master *master;
|
||||||
|
|
||||||
@ -367,6 +366,7 @@ void nhrp_multicast_interface_del(struct interface *ifp);
|
|||||||
void nhrp_multicast_foreach(struct interface *ifp, afi_t afi,
|
void nhrp_multicast_foreach(struct interface *ifp, afi_t afi,
|
||||||
void (*cb)(struct nhrp_multicast *, void *),
|
void (*cb)(struct nhrp_multicast *, void *),
|
||||||
void *ctx);
|
void *ctx);
|
||||||
|
void netlink_mcast_set_nflog_group(int nlgroup);
|
||||||
|
|
||||||
void nhrp_route_update_nhrp(const struct prefix *p, struct interface *ifp);
|
void nhrp_route_update_nhrp(const struct prefix *p, struct interface *ifp);
|
||||||
void nhrp_route_announce(int add, enum nhrp_cache_type type,
|
void nhrp_route_announce(int add, enum nhrp_cache_type type,
|
||||||
|
Loading…
Reference in New Issue
Block a user