summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/igmp.h
blob: 7b868aae7c9ae2892a37aae803943c5acc7b4fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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_ */