File tree Expand file tree Collapse file tree 2 files changed +33
-9
lines changed
netjsonconfig/backends/airos Expand file tree Collapse file tree 2 files changed +33
-9
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,26 @@ def type_to_role(self, typestr):
268268 }
269269 return roles .get (typestr , '' )
270270
271+ def autoneg_status (self , interface ):
272+ if interface .get ('autoneg' ):
273+ return 'enabled'
274+ else :
275+ return 'disabled'
276+
277+ def flowcontrol_status (self , interface ):
278+ if interface .get ('flowcontrol' ):
279+ status = 'enabled'
280+ else :
281+ status = 'disabled'
282+ return {
283+ 'rx' : {
284+ 'status' : status ,
285+ },
286+ 'tx' : {
287+ 'status' : status ,
288+ },
289+ }
290+
271291 def to_intermediate (self ):
272292 result = []
273293 interfaces = []
@@ -282,15 +302,9 @@ def to_intermediate(self):
282302 }
283303 # handle interface type quirks
284304 if interface ['type' ] == 'ethernet' and '.' not in interface ['name' ]:
285- base ['autoneg' ] = 'enabled'
286- base ['flowcontrol' ] = {
287- 'rx' : {
288- 'status' : 'enabled' ,
289- },
290- 'tx' : {
291- 'status' : 'enabled' ,
292- },
293- }
305+ base ['autoneg' ] = self .autoneg_status (interface )
306+
307+ base ['flowcontrol' ] = self .flowcontrol_status (interface )
294308
295309 if interface ['type' ] == 'wireless' :
296310 base ['devname' ] = interface ['wireless' ]['radio' ]
Original file line number Diff line number Diff line change 6060 },
6161 },
6262 },
63+ "interface_settings" : {
64+ "properties" : {
65+ "authoneg" : {
66+ "type" : "boolean" ,
67+ },
68+ "flowcontrol" : {
69+ "type" : "boolean" ,
70+ }
71+ }
72+ }
6373 },
6474 "properties" : {
6575 "netmode" : {
You can’t perform that action at this time.
0 commit comments