def _validate_interface_option(attr, value, addrfam='inet'):
 (valid, _value, errmsg) = (False, value, 'Unknown validator')
 attrmaps = ATTRMAPS.get(addrfam, [])
 for attrmap in attrmaps:
  if (attr in attrmap):
   validate_func = attrmap[attr]
   (valid, _value, errmsg) = validate_func(value)
   break
 return (valid, _value, errmsg)

def _validate_interface_option ( attr , value , addrfam = 'inet' ) : ( valid , _value , errmsg ) = ( False , value , 'Unknown validator' ) attrmaps = ATTRMAPS . get ( addrfam , [ ] ) for attrmap in attrmaps : if ( attr in attrmap ) : validate_func = attrmap [ attr ] ( valid , _value , errmsg ) = validate_func ( value ) break return ( valid , _value , errmsg )
lookup the validation function for a [addrfam][attr] and return the results .