@conf.commands.register
def srp1(*args, **kargs):
 if (not kargs.has_key('timeout')):
  kargs['timeout'] = (-1)
 (a, b) = srp(*args, **kargs)
 if (len(a) > 0):
  return a[0][1]
 else:
  return None

@ conf . commands . register def srp1 ( * args , ** kargs ) : if ( not kargs . has_key ( 'timeout' ) ) : kargs [ 'timeout' ] = ( - 1 ) ( a , b ) = srp ( * args , ** kargs ) if ( len ( a ) > 0 ) : return a [ 0 ] [ 1 ] else : return None
send and receive packets at layer 2 and return only the first answer nofilter: put 1 to avoid use of bpf filters retry: if positive .