當前位置: 首頁>>代碼示例>>Python>>正文


Python conf.L2socket方法代碼示例

本文整理匯總了Python中config.conf.L2socket方法的典型用法代碼示例。如果您正苦於以下問題:Python conf.L2socket方法的具體用法?Python conf.L2socket怎麽用?Python conf.L2socket使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在config.conf的用法示例。


在下文中一共展示了conf.L2socket方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: srp

# 需要導入模塊: from config import conf [as 別名]
# 或者: from config.conf import L2socket [as 別名]
def srp(x,iface=None, iface_hint=None, filter=None, nofilter=0, type=ETH_P_ALL, *args,**kargs):
    """Send and receive packets at layer 2
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
    if iface is None and iface_hint is not None:
        iface = conf.route.route(iface_hint)[0]
    s = conf.L2socket(iface=iface, filter=filter, nofilter=nofilter, type=type)
    a,b=sndrcv(s ,x,*args,**kargs)
    s.close()
    return a,b 
開發者ID:medbenali,項目名稱:CyberScan,代碼行數:20,代碼來源:sendrecv.py

示例2: sendp

# 需要導入模塊: from config import conf [as 別名]
# 或者: from config.conf import L2socket [as 別名]
def sendp(x, inter=0, loop=0, iface=None, iface_hint=None, count=None, verbose=None, realtime=None, *args, **kargs):
    """Send packets at layer 2
sendp(packets, [inter=0], [loop=0], [verbose=conf.verb]) -> None"""
    if iface is None and iface_hint is not None:
        iface = conf.route.route(iface_hint)[0]
    __gen_send(conf.L2socket(iface=iface, *args, **kargs), x, inter=inter, loop=loop, count=count, verbose=verbose, realtime=realtime) 
開發者ID:medbenali,項目名稱:CyberScan,代碼行數:8,代碼來源:sendrecv.py

示例3: srpflood

# 需要導入模塊: from config import conf [as 別名]
# 或者: from config.conf import L2socket [as 別名]
def srpflood(x,filter=None, iface=None, iface_hint=None, nofilter=None, *args,**kargs):
    """Flood and receive packets at layer 2
prn:      function applied to packets received. Ret val is printed if not None
store:    if 1 (default), store answers and return them
unique:   only consider packets whose print 
nofilter: put 1 to avoid use of bpf filters
filter:   provide a BPF filter
iface:    listen answers only on the given interface"""
    if iface is None and iface_hint is not None:
        iface = conf.route.route(iface_hint)[0]    
    s = conf.L2socket(filter=filter, iface=iface, nofilter=nofilter)
    r=sndrcvflood(s,x,*args,**kargs)
    s.close()
    return r 
開發者ID:medbenali,項目名稱:CyberScan,代碼行數:16,代碼來源:sendrecv.py

示例4: start

# 需要導入模塊: from config import conf [as 別名]
# 或者: from config.conf import L2socket [as 別名]
def start(self):
        self.s = conf.L2socket(iface=self.iface) 
開發者ID:theralfbrown,項目名稱:smod-1,代碼行數:4,代碼來源:scapypipes.py


注:本文中的config.conf.L2socket方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。