Ticket #31: scapy.patch
| File scapy.patch, 3.7 kB (added by craig@freescale.com, 2 years ago) |
|---|
-
./scapy.py
old new 19 19 ## ## 20 20 ############################################################################# 21 21 22 # Revision 1.0.5.1F 2006/10/17 16:50:19 yl 23 # - Added MPLS and IGMPv2 by Yi Lei 22 24 # 23 25 # $Log: scapy.py,v $ 24 26 # Revision 1.0.5.1 2006/10/19 15:56:43 pbi … … 1730 1732 1731 1733 from __future__ import generators 1732 1734 1733 RCSID="$Id: scapy.py,v 1.0.5.1 2006/10/19 15:56:43 pbi Exp $"1735 RCSID="$Id: scapy.py,v 1.0.5.1F 2006/10/19 15:56:43 pbi Exp $" 1734 1736 1735 1737 VERSION = RCSID.split()[2]+"beta" 1736 1738 … … 8053 8055 ShortEnumField("RR_CLASS",1,{1:"INTERNET"}), 8054 8056 IntField("TTL",0), 8055 8057 ShortField("RDLENGTH",83), 8056 ByteField("NUM_NAMES",1)]8058 ByteField("NUM_NAMES",1)] 8057 8059 8058 8060 # Service for Node Status Response 8059 8061 class NBNSNodeStatusResponseService(Packet): … … 8503 8505 IntField("padding2", 0) ] 8504 8506 8505 8507 8508 class MPLS(Packet): 8509 name = "MPLS" 8510 fields_desc = [ BitField("label", 3, 20), 8511 BitField("cos", 0, 3), 8512 BitField("s", 1, 1), 8513 ByteField("ttl", 0) ] 8514 8515 igmptypes = { 0x11 : "membership query", 8516 0x16 : "version 2 membership report", 8517 0x17 : "leave group", 8518 0x12 : "version 1 membership report" } 8519 8520 class IGMPV2(Packet): 8521 name = "IGMPV2" 8522 fields_desc = [ ByteEnumField("type",0x11, igmptypes), 8523 ByteField("maxResTime",1600), 8524 XShortField("chksum", None), 8525 IPField("gda", "0.0.0.0")] 8526 def post_build(self, p, pay): 8527 p += pay 8528 if self.chksum is None: 8529 ck = checksum(p) 8530 p = p[:2]+chr(ck>>8)+chr(ck&0xff)+p[4:] 8531 return p 8506 8532 8533 8507 8534 ################# 8508 8535 ## Bind layers ## 8509 8536 ################# … … 8559 8586 ( Ether, EAPOL, { "type" : 0x888e, "dst" : "01:80:c2:00:00:03" } ), 8560 8587 ( Ether, PPPoED, { "type" : 0x8863 } ), 8561 8588 ( Ether, PPPoE, { "type" : 0x8864 } ), 8589 ( Ether, MPLS, { "type" : 0x8847 } ), 8590 ( MPLS, IP, { } ), 8562 8591 ( CookedLinux, LLC, { "proto" : 0x007a } ), 8563 8592 ( CookedLinux, Dot1Q, { "proto" : 0x8100 } ), 8564 8593 ( CookedLinux, Ether, { "proto" : 0x0001 } ), … … 8585 8614 ( IPerror,IPerror, { "frag" : 0, "proto" : socket.IPPROTO_IP } ), 8586 8615 ( IPerror,ICMPerror,{ "frag" : 0, "proto" : socket.IPPROTO_ICMP } ), 8587 8616 ( IPerror,TCPerror, { "frag" : 0, "proto" : socket.IPPROTO_TCP } ), 8588 ( IPerror,UDPerror, { "frag" : 0, "proto" : socket.IPPROTO_UDP } ), 8617 ( IPerror,UDPerror, { "frag" : 0, "proto" : socket.IPPROTO_UDP } ), 8589 8618 ( IP, IP, { "frag" : 0, "proto" : socket.IPPROTO_IP } ), 8590 8619 ( IP, ICMP, { "frag" : 0, "proto" : socket.IPPROTO_ICMP } ), 8591 8620 ( IP, TCP, { "frag" : 0, "proto" : socket.IPPROTO_TCP } ), 8592 8621 ( IP, UDP, { "frag" : 0, "proto" : socket.IPPROTO_UDP } ), 8593 8622 ( IP, GRE, { "frag" : 0, "proto" : socket.IPPROTO_GRE } ), 8623 ( IP, IGMPV2, { "frag" : 0, "proto" : socket.IPPROTO_IGMP } ), 8594 8624 ( UDP, MGCP, { "dport" : 2727 } ), 8595 8625 ( UDP, MGCP, { "sport" : 2727 } ), 8596 8626 ( UDP, DNS, { "dport" : 53 } ),