summaryrefslogtreecommitdiffstats
path: root/pimd/pim_igmp.h
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_igmp.h')
-rw-r--r--pimd/pim_igmp.h164
1 files changed, 79 insertions, 85 deletions
diff --git a/pimd/pim_igmp.h b/pimd/pim_igmp.h
index 2f36094bd..275f25f63 100644
--- a/pimd/pim_igmp.h
+++ b/pimd/pim_igmp.h
@@ -41,8 +41,8 @@
#define IGMP_V3_REPORT_HEADER_SIZE (8)
#define IGMP_V3_GROUP_RECORD_MIN_SIZE (8)
-#define IGMP_V3_MSG_MIN_SIZE (IGMP_V3_REPORT_HEADER_SIZE + \
- IGMP_V3_GROUP_RECORD_MIN_SIZE)
+#define IGMP_V3_MSG_MIN_SIZE \
+ (IGMP_V3_REPORT_HEADER_SIZE + IGMP_V3_GROUP_RECORD_MIN_SIZE)
#define IGMP_V12_MSG_SIZE (8)
#define IGMP_V3_GROUP_RECORD_TYPE_OFFSET (0)
@@ -67,40 +67,40 @@
#define IGMP_DEFAULT_VERSION (3)
struct igmp_join {
- struct in_addr group_addr;
- struct in_addr source_addr;
- int sock_fd;
- time_t sock_creation;
+ struct in_addr group_addr;
+ struct in_addr source_addr;
+ int sock_fd;
+ time_t sock_creation;
};
struct igmp_sock {
- int fd;
- struct interface *interface;
- struct in_addr ifaddr;
- time_t sock_creation;
-
- struct thread *t_igmp_read; /* read: IGMP sockets */
- struct thread *t_igmp_query_timer; /* timer: issue IGMP general queries */
- struct thread *t_other_querier_timer; /* timer: other querier present */
-
- int querier_query_interval; /* QQI */
- int querier_robustness_variable; /* QRV */
- int startup_query_count;
-
- struct list *igmp_group_list; /* list of struct igmp_group */
- struct hash *igmp_group_hash;
+ int fd;
+ struct interface *interface;
+ struct in_addr ifaddr;
+ time_t sock_creation;
+
+ struct thread *t_igmp_read; /* read: IGMP sockets */
+ struct thread
+ *t_igmp_query_timer; /* timer: issue IGMP general queries */
+ struct thread *t_other_querier_timer; /* timer: other querier present */
+
+ int querier_query_interval; /* QQI */
+ int querier_robustness_variable; /* QRV */
+ int startup_query_count;
+
+ struct list *igmp_group_list; /* list of struct igmp_group */
+ struct hash *igmp_group_hash;
};
struct igmp_sock *pim_igmp_sock_lookup_ifaddr(struct list *igmp_sock_list,
struct in_addr ifaddr);
-struct igmp_sock *igmp_sock_lookup_by_fd(struct list *igmp_sock_list,
- int fd);
+struct igmp_sock *igmp_sock_lookup_by_fd(struct list *igmp_sock_list, int fd);
struct igmp_sock *pim_igmp_sock_add(struct list *igmp_sock_list,
struct in_addr ifaddr,
struct interface *ifp);
void igmp_sock_delete(struct igmp_sock *igmp);
void igmp_sock_free(struct igmp_sock *igmp);
-void igmp_sock_delete_all (struct interface *ifp);
+void igmp_sock_delete_all(struct interface *ifp);
int pim_igmp_packet(struct igmp_sock *igmp, char *buf, size_t len);
void pim_igmp_general_query_on(struct igmp_sock *igmp);
@@ -122,52 +122,53 @@ void pim_igmp_other_querier_timer_off(struct igmp_sock *igmp);
#define IGMP_SOURCE_DONT_SEND(flags) ((flags) &= ~IGMP_SOURCE_MASK_SEND)
struct igmp_source {
- struct in_addr source_addr;
- struct thread *t_source_timer;
- struct igmp_group *source_group; /* back pointer */
- time_t source_creation;
- uint32_t source_flags;
- struct channel_oil *source_channel_oil;
-
- /*
- RFC 3376: 6.6.3.2. Building and Sending Group and Source Specific Queries
- */
- int source_query_retransmit_count;
+ struct in_addr source_addr;
+ struct thread *t_source_timer;
+ struct igmp_group *source_group; /* back pointer */
+ time_t source_creation;
+ uint32_t source_flags;
+ struct channel_oil *source_channel_oil;
+
+ /*
+ RFC 3376: 6.6.3.2. Building and Sending Group and Source Specific
+ Queries
+ */
+ int source_query_retransmit_count;
};
struct igmp_group {
- /*
- RFC 3376: 6.2.2. Definition of Group Timers
-
- The group timer is only used when a group is in EXCLUDE mode and it
- represents the time for the *filter-mode* of the group to expire and
- switch to INCLUDE mode.
- */
- struct thread *t_group_timer;
-
- /* Shared between group-specific and
- group-and-source-specific retransmissions */
- struct thread *t_group_query_retransmit_timer;
-
- /* Counter exclusive for group-specific retransmissions
- (not used by group-and-source-specific retransmissions,
- since sources have their counters) */
- int group_specific_query_retransmit_count;
-
- /* compatibility mode - igmp v1, v2 or v3 */
- int igmp_version;
-
- struct in_addr group_addr;
- int group_filtermode_isexcl; /* 0=INCLUDE, 1=EXCLUDE */
- struct list *group_source_list; /* list of struct igmp_source */
- time_t group_creation;
- struct igmp_sock *group_igmp_sock; /* back pointer */
- int64_t last_igmp_v1_report_dsec;
- int64_t last_igmp_v2_report_dsec;
+ /*
+ RFC 3376: 6.2.2. Definition of Group Timers
+
+ The group timer is only used when a group is in EXCLUDE mode and it
+ represents the time for the *filter-mode* of the group to expire and
+ switch to INCLUDE mode.
+ */
+ struct thread *t_group_timer;
+
+ /* Shared between group-specific and
+ group-and-source-specific retransmissions */
+ struct thread *t_group_query_retransmit_timer;
+
+ /* Counter exclusive for group-specific retransmissions
+ (not used by group-and-source-specific retransmissions,
+ since sources have their counters) */
+ int group_specific_query_retransmit_count;
+
+ /* compatibility mode - igmp v1, v2 or v3 */
+ int igmp_version;
+
+ struct in_addr group_addr;
+ int group_filtermode_isexcl; /* 0=INCLUDE, 1=EXCLUDE */
+ struct list *group_source_list; /* list of struct igmp_source */
+ time_t group_creation;
+ struct igmp_sock *group_igmp_sock; /* back pointer */
+ int64_t last_igmp_v1_report_dsec;
+ int64_t last_igmp_v2_report_dsec;
};
-struct igmp_group *find_group_by_addr (struct igmp_sock *igmp,
- struct in_addr group_addr);
+struct igmp_group *find_group_by_addr(struct igmp_sock *igmp,
+ struct in_addr group_addr);
struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
struct in_addr group_addr);
@@ -175,24 +176,17 @@ void igmp_group_delete_empty_include(struct igmp_group *group);
void igmp_startup_mode_on(struct igmp_sock *igmp);
-void igmp_group_timer_on(struct igmp_group *group,
- long interval_msec, const char *ifname);
-
-struct igmp_source *
-source_new (struct igmp_group *group,
- struct in_addr src_addr);
-
-void igmp_send_query(int igmp_version,
- struct igmp_group *group,
- int fd,
- const char *ifname,
- char *query_buf,
- int query_buf_size,
- int num_sources,
- struct in_addr dst_addr,
- struct in_addr group_addr,
- int query_max_response_time_dsec,
- uint8_t s_flag,
- uint8_t querier_robustness_variable,
- uint16_t querier_query_interval);
+void igmp_group_timer_on(struct igmp_group *group, long interval_msec,
+ const char *ifname);
+
+struct igmp_source *source_new(struct igmp_group *group,
+ struct in_addr src_addr);
+
+void igmp_send_query(int igmp_version, struct igmp_group *group, int fd,
+ const char *ifname, char *query_buf, int query_buf_size,
+ int num_sources, struct in_addr dst_addr,
+ struct in_addr group_addr,
+ int query_max_response_time_dsec, uint8_t s_flag,
+ uint8_t querier_robustness_variable,
+ uint16_t querier_query_interval);
#endif /* PIM_IGMP_H */