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


Python l2.Dot3方法代碼示例

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


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

示例1: constructPAS5211Frames

# 需要導入模塊: from scapy.layers import l2 [as 別名]
# 或者: from scapy.layers.l2 import Dot3 [as 別名]
def constructPAS5211Frames(msg, seq, src_mac, dst_mac, channel_id=-1,
                           onu_id=-1, onu_session_id=-1):

    assert isinstance(msg, PAS5211Msg)
    opcode = 0x3000 | msg.opcode

    inner_msg = PAS5211MsgHeader(
        sequence_number=seq,
        opcode=opcode,
        channel_id=channel_id,
        onu_id=onu_id,
        onu_session_id=onu_session_id
    ) / msg

    size = len(inner_msg)
    frame_body = PAS5211FrameHeader(size=size) / inner_msg
    frame = Dot3(src=src_mac, dst=dst_mac) / frame_body

    return frame 
開發者ID:opencord,項目名稱:voltha,代碼行數:21,代碼來源:PAS5211_comm.py

示例2: negotiate_trunk

# 需要導入模塊: from scapy.layers import l2 [as 別名]
# 或者: from scapy.layers.l2 import Dot3 [as 別名]
def negotiate_trunk(iface=conf.iface, mymac=str(RandMAC())):
    print "Trying to negotiate a trunk on interface %s" % iface
    p = Dot3(src=mymac, dst="01:00:0c:cc:cc:cc")/LLC()/SNAP()/DTP(tlvlist=[DTPDomain(),DTPStatus(),DTPType(),DTPNeighbor(neighbor=mymac)])
    sendp(p) 
開發者ID:theralfbrown,項目名稱:smod-1,代碼行數:6,代碼來源:dtp.py

示例3: negotiate_trunk

# 需要導入模塊: from scapy.layers import l2 [as 別名]
# 或者: from scapy.layers.l2 import Dot3 [as 別名]
def negotiate_trunk(iface=conf.iface, mymac=str(RandMAC())):
    print("Trying to negotiate a trunk on interface %s" % iface)
    p = Dot3(src=mymac, dst="01:00:0c:cc:cc:cc") / LLC()
    p /= SNAP()
    p /= DTP(tlvlist=[DTPDomain(), DTPStatus(), DTPType(), DTPNeighbor(neighbor=mymac)])  # noqa: E501
    sendp(p) 
開發者ID:secdev,項目名稱:scapy,代碼行數:8,代碼來源:dtp.py

示例4: negotiate_trunk

# 需要導入模塊: from scapy.layers import l2 [as 別名]
# 或者: from scapy.layers.l2 import Dot3 [as 別名]
def negotiate_trunk(iface=conf.iface, mymac=str(RandMAC())):
    print("Trying to negotiate a trunk on interface %s" % iface)
    p = Dot3(src=mymac, dst="01:00:0c:cc:cc:cc")/LLC()/SNAP()/DTP(tlvlist=[DTPDomain(),DTPStatus(),DTPType(),DTPNeighbor(neighbor=mymac)])
    sendp(p) 
開發者ID:entynetproject,項目名稱:arissploit,代碼行數:6,代碼來源:dtp.py


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