summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/igmp.h
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2019-06-24 17:01:54 +0200
committerXavier Simonart <xavier.simonart@intel.com>2019-10-09 19:09:34 +0200
commit48f8c3d212644a33dd0abaaa1a0c71d4decaafdf (patch)
tree515043d3dc43025bb5ce5e6cb842afd68ae891e9 /VNFs/DPPD-PROX/igmp.h
parent4cc4dabe80eb7d19c20920b7ec20899d6a76a1dd (diff)
Add support for igmp and multicast
Multicast can be enabled through configuration or through command line - Through configuration Add multicast=mcast_address (e.g. multicast=01:00:5e:01:02:03) in the port section - Through command line run enable multicast port_id mcast_address (e.g. enable multicast 1 01:00:5e:01:02:03) IGMP join message is sent unsollicited through command line: join igmp core_id task_id ip (e.g. join igmp 1 0 224.1.1.3) To enable swap answering IGMP Query (w/ IGMP Join) - Through configuration Add igmp ipv4=ip_address within the core/task section - Through command line join igmp core_id task_id ip (e.g. join igmp 1 0 224.1.1.3) (this will 1st initiate an unsollicated join, then answer any subsequent query) UDP/TCP packets received on a multicast address (224.0.0.0 => 239.255.255.255) are discarded To stop sending responses to IGMP query: leave igmp core_id task_id Change-Id: I3808ccabf3b38b5a1e10e1b044db63aa05bcd7b5 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/igmp.h')
-rw-r--r--VNFs/DPPD-PROX/igmp.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/igmp.h b/VNFs/DPPD-PROX/igmp.h
new file mode 100644
index 00000000..7b868aae
--- /dev/null
+++ b/VNFs/DPPD-PROX/igmp.h
@@ -0,0 +1,59 @@
+/*
+// Copyright (c) 2019 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+
+#ifndef _IGMP_H_
+#define _IGMP_H_
+
+#define IGMP_MEMBERSHIP_QUERY 0x11
+#define IGMP_MEMBERSHIP_REPORT_V1 0x12
+#define IGMP_MEMBERSHIP_REPORT 0x16
+#define IGMP_LEAVE_GROUP 0x17
+
+struct igmpv1_hdr {
+ uint8_t type: 4; /* type */
+ uint8_t version: 4; /* version */
+ uint8_t unused; /* unused */
+ uint16_t checksum; /* checksum */
+ uint32_t group_address; /* group address */
+} __attribute__((__packed__));
+
+struct igmpv2_hdr {
+ uint8_t type; /* type */
+ uint8_t max_resp_time; /* maximum response time */
+ uint16_t checksum; /* checksum */
+ uint32_t group_address; /* group address */
+} __attribute__((__packed__));
+
+struct igmpv3_hdr {
+ uint8_t type; /* type */
+ uint8_t max_resp_time; /* maximum response time */
+ uint16_t checksum; /* checksum */
+ uint32_t group_address; /* group address */
+ uint8_t bits: 4; /* S(suppress router-side processing)QRV(Querier.s Robustness Variable) bits */
+ uint8_t reserved: 4; /* reserved */
+ uint8_t QQIC; /* Querier.s Query Interval Code */
+ uint16_t n_src; /* Number of source addresses */
+} __attribute__((__packed__));
+
+struct task_base;
+
+// igmp_join and leave functions are so far implemented within handle_swap.
+// Only swap task can use them right now, as they use igmp_pool
+// only defined in swap task.
+void igmp_join_group(struct task_base *tbase, uint32_t igmp_address);
+void igmp_leave_group(struct task_base *tbase);
+
+#endif /* _IGMP_H_ */