IGMP improvements
[vpp.git] / src / plugins / igmp / igmp_ssm_range.h
1 /*
2  *------------------------------------------------------------------
3  * Copyright (c) 2017 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *------------------------------------------------------------------
16  */
17
18 #ifndef __IGMP_SSM_RANGE_H__
19 #define __IGMP_SSM_RANGE_H__
20
21 #include <igmp/igmp.h>
22
23 /**
24  * Make sure this remains in-sync with the .api enum definition
25  */
26 #define foreach_igmp_group_prefix_type                  \
27   _ (0x0, ASM)                                          \
28   _ (0x1, SSM)
29
30 typedef enum igmp_group_prefix_type_t_
31 {
32 #define _(n,f) IGMP_GROUP_PREFIX_TYPE_##f = n,
33   foreach_igmp_group_prefix_type
34 #undef _
35 } igmp_group_prefix_type_t;
36
37 extern igmp_group_prefix_type_t igmp_group_prefix_get_type (const
38                                                             ip46_address_t *
39                                                             gaddr);
40
41 extern void igmp_group_prefix_set (const fib_prefix_t * pfx,
42                                    igmp_group_prefix_type_t type);
43
44 typedef walk_rc_t (*igmp_ssm_range_walk_t) (const fib_prefix_t * pfx,
45                                             igmp_group_prefix_type_t type,
46                                             void *ctx);
47
48 extern void igmp_ssm_range_walk (igmp_ssm_range_walk_t fn, void *ctx);
49
50 #endif
51
52 /*
53  * fd.io coding-style-patch-verification: ON
54  *
55  * Local Variables:
56  * eval: (c-set-style "gnu")
57  * End:
58  */