(*args,**kargs)
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, how many times to resend unanswered packets
          if negative, how many times to retry when no more packets are answered
timeout:  how much time to wait after the last packet has been sent
verbose:  set verbosity level
multi:    whether to accept multiple answers for the same stimulus
filter:   provide a BPF filter
iface:    work only on the given interface
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, how many times to resend unanswered packets
          if negative, how many times to retry when no more packets are answered
timeout:  how much time to wait after the last packet has been sent
verbose:  set verbosity level
multi:    whether to accept multiple answers for the same stimulus
filter:   provide a BPF filter
iface:    work only on the given interface
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 how many times to resend unanswered packets if negative how many times to retry when no more packets are answered timeout : how much time to wait after the last packet has been sent verbose : set verbosity level multi : whether to accept multiple answers for the same stimulus filter : provide a BPF filter iface : work only on the given interface
def srp1(*args,**kargs):
    """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, how many times to resend unanswered packets
          if negative, how many times to retry when no more packets are answered
timeout:  how much time to wait after the last packet has been sent
verbose:  set verbosity level
multi:    whether to accept multiple answers for the same stimulus
filter:   provide a BPF filter
iface:    work only on the given interface"""
    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
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