@@ -86,13 +86,18 @@ type SimModeInfo struct {
86
86
87
87
// CPIfaceInfo : CPIface interface settings.
88
88
type CPIfaceInfo struct {
89
- Peers []string `json:"peers"`
90
- UseFQDN bool `json:"use_fqdn"`
91
- NodeID string `json:"hostname"`
92
- HTTPPort string `json:"http_port"`
93
- Dnn string `json:"dnn"`
94
- EnableUeIPAlloc bool `json:"enable_ue_ip_alloc"`
95
- UEIPPool string `json:"ue_ip_pool"`
89
+ Peers []string `json:"peers"`
90
+ UseFQDN bool `json:"use_fqdn"`
91
+ NodeID string `json:"hostname"`
92
+ HTTPPort string `json:"http_port"`
93
+ DnnList []DNNInfo `json:"dnn_list"`
94
+ EnableUeIPAlloc bool `json:"enable_ue_ip_alloc"`
95
+ UEIPPool string `json:"ue_ip_pool"`
96
+ }
97
+
98
+ type DNNInfo struct {
99
+ DNN string `json:"dnn"`
100
+ UEIPPool string `json:"ue_ip_pool"`
96
101
}
97
102
98
103
// IfaceType : Gateway interface struct.
@@ -118,12 +123,12 @@ func validateConf(conf Conf) error {
118
123
if err != nil {
119
124
return ErrInvalidArgumentWithReason ("conf.P4rtcIface.AccessIP" , conf .P4rtcIface .AccessIP , err .Error ())
120
125
}
121
-
122
- _ , _ , err = net .ParseCIDR (conf .CPIface .UEIPPool )
123
- if err != nil {
124
- return ErrInvalidArgumentWithReason ("conf.UEIPPool" , conf .CPIface .UEIPPool , err .Error ())
126
+ for _ , dnn := range conf .CPIface .DnnList {
127
+ _ , _ , err := net .ParseCIDR (dnn .UEIPPool )
128
+ if err != nil {
129
+ return ErrInvalidArgumentWithReason ("conf.CPIface.DnnList.UEIPPool" , dnn .UEIPPool , err .Error ())
130
+ }
125
131
}
126
-
127
132
if conf .Mode != "" {
128
133
return ErrInvalidArgumentWithReason ("conf.Mode" , conf .Mode , "mode must not be set for UP4" )
129
134
}
@@ -140,14 +145,14 @@ func validateConf(conf Conf) error {
140
145
return ErrInvalidArgumentWithReason ("conf.Mode" , conf .Mode , "invalid mode" )
141
146
}
142
147
}
143
-
144
148
if conf .CPIface .EnableUeIPAlloc {
145
- _ , _ , err := net .ParseCIDR (conf .CPIface .UEIPPool )
146
- if err != nil {
147
- return ErrInvalidArgumentWithReason ("conf.UEIPPool" , conf .CPIface .UEIPPool , err .Error ())
149
+ for _ , dnn := range conf .CPIface .DnnList {
150
+ _ , _ , err := net .ParseCIDR (dnn .UEIPPool )
151
+ if err != nil {
152
+ return ErrInvalidArgumentWithReason ("conf.CPIface.DnnList.UEIPPool" , dnn .UEIPPool , err .Error ())
153
+ }
148
154
}
149
155
}
150
-
151
156
for _ , peer := range conf .CPIface .Peers {
152
157
ip := net .ParseIP (peer )
153
158
if ip == nil {
0 commit comments