summaryrefslogtreecommitdiffstats
path: root/pimd/pim_igmp.c
diff options
context:
space:
mode:
authorSai Gomathi <nsaigomathi@vmware.com>2021-12-03 19:23:23 +0100
committerSai Gomathi <nsaigomathi@vmware.com>2021-12-03 19:27:12 +0100
commitc5f76fad1a2b0f6127d7b8ef94f24798e60dbbd6 (patch)
treed71cde145cd4b37ae8f2cd983955ae54328d4845 /pimd/pim_igmp.c
parentpimd: Modifying name of struct igmp_group to struct gm_group for IPv6. (diff)
downloadfrr-c5f76fad1a2b0f6127d7b8ef94f24798e60dbbd6.tar.xz
frr-c5f76fad1a2b0f6127d7b8ef94f24798e60dbbd6.zip
pimd: Modifying struct igmp_sock to gm_sock for IPv6
Modifying name of struct igmp_sock to struct gm_sock, which is to be used by both IPv4 and IPv6(for both MLD and IGMP). Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
Diffstat (limited to 'pimd/pim_igmp.c')
-rw-r--r--pimd/pim_igmp.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
index 81b85f1f5..5b201c858 100644
--- a/pimd/pim_igmp.c
+++ b/pimd/pim_igmp.c
@@ -115,7 +115,7 @@ static void igmp_sock_dump(array_t *igmp_sock_array)
int size = array_size(igmp_sock_array);
for (int i = 0; i < size; ++i) {
- struct igmp_sock *igmp = array_get(igmp_sock_array, i);
+ struct gm_sock *igmp = array_get(igmp_sock_array, i);
zlog_debug("%s %s: [%d/%d] igmp_addr=%pI4 fd=%d", __FILE__,
__func__, i, size, &igmp->ifaddr,
@@ -124,11 +124,11 @@ static void igmp_sock_dump(array_t *igmp_sock_array)
}
#endif
-struct igmp_sock *pim_igmp_sock_lookup_ifaddr(struct list *igmp_sock_list,
- struct in_addr ifaddr)
+struct gm_sock *pim_igmp_sock_lookup_ifaddr(struct list *igmp_sock_list,
+ struct in_addr ifaddr)
{
struct listnode *sock_node;
- struct igmp_sock *igmp;
+ struct gm_sock *igmp;
#ifdef IGMP_SOCK_DUMP
igmp_sock_dump(igmp_sock_list);
@@ -143,7 +143,7 @@ struct igmp_sock *pim_igmp_sock_lookup_ifaddr(struct list *igmp_sock_list,
static int pim_igmp_other_querier_expire(struct thread *t)
{
- struct igmp_sock *igmp;
+ struct gm_sock *igmp;
igmp = THREAD_ARG(t);
@@ -170,7 +170,7 @@ static int pim_igmp_other_querier_expire(struct thread *t)
return 0;
}
-void pim_igmp_other_querier_timer_on(struct igmp_sock *igmp)
+void pim_igmp_other_querier_timer_on(struct gm_sock *igmp)
{
long other_querier_present_interval_msec;
struct pim_interface *pim_ifp;
@@ -243,7 +243,7 @@ void pim_igmp_other_querier_timer_on(struct igmp_sock *igmp)
&igmp->t_other_querier_timer);
}
-void pim_igmp_other_querier_timer_off(struct igmp_sock *igmp)
+void pim_igmp_other_querier_timer_off(struct gm_sock *igmp)
{
assert(igmp);
@@ -281,7 +281,7 @@ int igmp_validate_checksum(char *igmp_msg, int igmp_msg_len)
return 0;
}
-static int igmp_recv_query(struct igmp_sock *igmp, int query_version,
+static int igmp_recv_query(struct gm_sock *igmp, int query_version,
int max_resp_code, struct in_addr from,
const char *from_str, char *igmp_msg,
int igmp_msg_len)
@@ -410,7 +410,7 @@ static void on_trace(const char *label, struct interface *ifp,
}
}
-static int igmp_v1_recv_report(struct igmp_sock *igmp, struct in_addr from,
+static int igmp_v1_recv_report(struct gm_sock *igmp, struct in_addr from,
const char *from_str, char *igmp_msg,
int igmp_msg_len)
{
@@ -517,7 +517,7 @@ bool pim_igmp_verify_header(struct ip *ip_hdr, size_t len, size_t *hlen)
return true;
}
-int pim_igmp_packet(struct igmp_sock *igmp, char *buf, size_t len)
+int pim_igmp_packet(struct gm_sock *igmp, char *buf, size_t len)
{
struct ip *ip_hdr = (struct ip *)buf;
size_t ip_hlen; /* ip header length in bytes */
@@ -606,7 +606,7 @@ int pim_igmp_packet(struct igmp_sock *igmp, char *buf, size_t len)
return -1;
}
-void pim_igmp_general_query_on(struct igmp_sock *igmp)
+void pim_igmp_general_query_on(struct gm_sock *igmp)
{
struct pim_interface *pim_ifp;
int startup_mode;
@@ -662,7 +662,7 @@ void pim_igmp_general_query_on(struct igmp_sock *igmp)
query_interval, &igmp->t_igmp_query_timer);
}
-void pim_igmp_general_query_off(struct igmp_sock *igmp)
+void pim_igmp_general_query_off(struct gm_sock *igmp)
{
assert(igmp);
@@ -682,7 +682,7 @@ void pim_igmp_general_query_off(struct igmp_sock *igmp)
/* Issue IGMP general query */
static int pim_igmp_general_query(struct thread *t)
{
- struct igmp_sock *igmp;
+ struct gm_sock *igmp;
struct in_addr dst_addr;
struct in_addr group_addr;
struct pim_interface *pim_ifp;
@@ -738,7 +738,7 @@ static int pim_igmp_general_query(struct thread *t)
return 0;
}
-static void sock_close(struct igmp_sock *igmp)
+static void sock_close(struct gm_sock *igmp)
{
pim_igmp_other_querier_timer_off(igmp);
pim_igmp_general_query_off(igmp);
@@ -768,7 +768,7 @@ static void sock_close(struct igmp_sock *igmp)
}
}
-void igmp_startup_mode_on(struct igmp_sock *igmp)
+void igmp_startup_mode_on(struct gm_sock *igmp)
{
struct pim_interface *pim_ifp;
@@ -857,7 +857,7 @@ void igmp_group_delete_empty_include(struct gm_group *group)
igmp_group_delete(group);
}
-void igmp_sock_free(struct igmp_sock *igmp)
+void igmp_sock_free(struct gm_sock *igmp)
{
assert(!igmp->t_igmp_read);
assert(!igmp->t_igmp_query_timer);
@@ -866,7 +866,7 @@ void igmp_sock_free(struct igmp_sock *igmp)
XFREE(MTYPE_PIM_IGMP_SOCKET, igmp);
}
-void igmp_sock_delete(struct igmp_sock *igmp)
+void igmp_sock_delete(struct gm_sock *igmp)
{
struct pim_interface *pim_ifp;
@@ -886,7 +886,7 @@ void igmp_sock_delete_all(struct interface *ifp)
{
struct pim_interface *pim_ifp;
struct listnode *igmp_node, *igmp_nextnode;
- struct igmp_sock *igmp;
+ struct gm_sock *igmp;
pim_ifp = ifp->info;
@@ -953,11 +953,11 @@ void pim_igmp_if_fini(struct pim_interface *pim_ifp)
list_delete(&pim_ifp->socket_list);
}
-static struct igmp_sock *igmp_sock_new(int fd, struct in_addr ifaddr,
- struct interface *ifp, int mtrace_only)
+static struct gm_sock *igmp_sock_new(int fd, struct in_addr ifaddr,
+ struct interface *ifp, int mtrace_only)
{
struct pim_interface *pim_ifp;
- struct igmp_sock *igmp;
+ struct gm_sock *igmp;
pim_ifp = ifp->info;
@@ -1000,12 +1000,12 @@ static struct igmp_sock *igmp_sock_new(int fd, struct in_addr ifaddr,
return igmp;
}
-static void igmp_read_on(struct igmp_sock *igmp);
+static void igmp_read_on(struct gm_sock *igmp);
static int pim_igmp_read(struct thread *t)
{
uint8_t buf[10000];
- struct igmp_sock *igmp = (struct igmp_sock *)THREAD_ARG(t);
+ struct gm_sock *igmp = (struct gm_sock *)THREAD_ARG(t);
struct sockaddr_in from;
struct sockaddr_in to;
socklen_t fromlen = sizeof(from);
@@ -1031,7 +1031,7 @@ done:
return 0;
}
-static void igmp_read_on(struct igmp_sock *igmp)
+static void igmp_read_on(struct gm_sock *igmp)
{
if (PIM_DEBUG_IGMP_TRACE_DETAIL) {
@@ -1042,13 +1042,12 @@ static void igmp_read_on(struct igmp_sock *igmp)
&igmp->t_igmp_read);
}
-struct igmp_sock *pim_igmp_sock_add(struct list *igmp_sock_list,
- struct in_addr ifaddr,
- struct interface *ifp,
- bool mtrace_only)
+struct gm_sock *pim_igmp_sock_add(struct list *igmp_sock_list,
+ struct in_addr ifaddr, struct interface *ifp,
+ bool mtrace_only)
{
struct pim_interface *pim_ifp;
- struct igmp_sock *igmp;
+ struct gm_sock *igmp;
struct sockaddr_in sin;
int fd;
@@ -1180,7 +1179,7 @@ void igmp_group_timer_on(struct gm_group *group, long interval_msec,
interval_msec, &group->t_group_timer);
}
-struct gm_group *find_group_by_addr(struct igmp_sock *igmp,
+struct gm_group *find_group_by_addr(struct gm_sock *igmp,
struct in_addr group_addr)
{
struct gm_group lookup;
@@ -1191,7 +1190,7 @@ struct gm_group *find_group_by_addr(struct igmp_sock *igmp,
return hash_lookup(pim_ifp->group_hash, &lookup);
}
-struct gm_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
+struct gm_group *igmp_add_group_by_addr(struct gm_sock *igmp,
struct in_addr group_addr)
{
struct gm_group *group;
@@ -1300,7 +1299,7 @@ void igmp_send_query_on_intf(struct interface *ifp, int igmp_ver)
{
struct pim_interface *pim_ifp = ifp->info;
struct listnode *sock_node = NULL;
- struct igmp_sock *igmp = NULL;
+ struct gm_sock *igmp = NULL;
struct in_addr dst_addr;
struct in_addr group_addr;
int query_buf_size;