Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2022-present Open Networking Foundation |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | package common |
| 17 | |
| 18 | // IGMPConfig identifies the IGMP Configuration parameters. |
| 19 | type IGMPConfig struct { |
vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 20 | FastLeave *bool `json:"FastLeave"` |
| 21 | // PeriodicQuery represents IGMP period query interval. |
| 22 | PeriodicQuery *bool `json:"PeriodicQuery"` |
| 23 | // WithRAUpLink represents IGMP RA uplink. |
| 24 | WithRAUpLink *bool `json:"withRAUpLink"` |
| 25 | // WithRADownLink represents IGMP RA downlink. |
| 26 | WithRADownLink *bool `json:"withRADownLink"` |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 27 | // ProfileID represents IGMP profile ID |
| 28 | ProfileID string `json:"ProfileID"` |
| 29 | // ProfileName represents IGMP profile Name |
| 30 | ProfileName string `json:"ProfileName"` |
vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 31 | // IgmpVerToServer represents IGMP version. |
| 32 | IgmpVerToServer string `json:"igmpVerToServer"` |
| 33 | // IgmpSourceIP represents IGMP src ip. |
| 34 | IgmpSourceIP string `json:"igmpSourceIp"` |
| 35 | // FastLeave represents IGMP fast leave enabled or not. |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 36 | // UnsolicitedTimeOut represents unsolicited timeout. |
| 37 | UnsolicitedTimeOut int `json:"UnsolicitedTimeOut"` |
| 38 | // MaxResp represents IGMP max response time. |
| 39 | MaxResp int `json:"MaxResp"` |
| 40 | // KeepAliveInterval represents IGMP keep alive interval. |
| 41 | KeepAliveInterval int `json:"KeepAliveInterval"` |
| 42 | // KeepAliveCount represents IGMP keep alive count. |
| 43 | KeepAliveCount int `json:"KeepAliveCount"` |
| 44 | // LastQueryInterval represents IGMP last query interval. |
| 45 | LastQueryInterval int `json:"LastQueryInterval"` |
| 46 | // LastQueryCount represents IGMP last query count. |
| 47 | LastQueryCount int `json:"LastQueryCount"` |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 48 | // IgmpCos represents IGMP COS value(0-7). |
| 49 | IgmpCos int `json:"IgmpCos"` |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 50 | } |
| 51 | |
vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 52 | // MulticastSrcListMode represents mode of source list |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 53 | type MulticastSrcListMode string |
| 54 | |
| 55 | const ( |
| 56 | //Include refers to MulticastSrcListMode as include |
| 57 | Include MulticastSrcListMode = "include" |
| 58 | //Exclude refers to MulticastSrcListMode as exclude |
| 59 | Exclude MulticastSrcListMode = "exclude" |
| 60 | // StaticGroup refes to the static group name |
| 61 | StaticGroup string = "static" |
| 62 | // IsStaticYes refes to the static flag value yes |
| 63 | IsStaticYes string = "yes" |
| 64 | // IsStaticNo refes to the static flag value no |
| 65 | IsStaticNo string = "no" |
| 66 | ) |
| 67 | |
| 68 | // MulticastGroupProxy identifies source specific multicast(SSM) config. |
| 69 | type MulticastGroupProxy struct { |
| 70 | // Mode represents source list include/exclude |
| 71 | Mode MulticastSrcListMode `json:"Mode"` |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 72 | // IsStatic flag indicating if the group is a "static" group |
| 73 | IsStatic string `json:"IsStatic,omitempty"` |
vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 74 | // SourceList represents list of multicast server IP addresses. |
| 75 | SourceList []string `json:"SourceList"` |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | // MVLANProfile identifies the MVLAN profile. |
| 79 | type MVLANProfile struct { |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 80 | // Groups represents the MVLAN group information. Key will be group name and value as array of multicast channel IPs. |
| 81 | Groups map[string][]string `json:"Groups"` |
| 82 | // Proxy represents multicast group proxy info. Key will be group name and value as proxy info |
| 83 | Proxy map[string]MulticastGroupProxy `json:"Proxy"` |
vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 84 | // ProfileID represents Multicast profile ID |
| 85 | ProfileID string `json:"ProfileID"` |
| 86 | // ProfileName represents Multicast profile Name |
| 87 | ProfileName string `json:"ProfileName"` |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 88 | // ActiveIgmpChannelsPerSubscriber represents maximum igmp channels per subscriber can use |
| 89 | // Default : 3 |
| 90 | ActiveIgmpChannelsPerSubscriber int `json:"ActiveIgmpChannelsPerSubscriber"` |
vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 91 | // VLANID represents the Multicast VLAN ID. |
| 92 | VLANID int `json:"VLANID"` |
| 93 | // PonVLAN represents the vlan, where mcast traffic will be translated at OLT |
| 94 | PonVLAN int `json:"PonVLAN"` |
| 95 | //IsChannelBasedGroup represents if the group is channel based |
| 96 | IsChannelBasedGroup bool `json:"IsChannelBasedGroup"` |
Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | // McastConfig the structure for multicast config |
| 100 | type McastConfig struct { |
| 101 | MVLANProfileID string |
| 102 | IGMPProfileID string |
| 103 | IGMPSrcIP string |
| 104 | } |