Ϫf dZddlZddlZddlmZddlmZddlmZGddZ dZ eejGd d ejZ y) z,Support for working directly with IP packetsN) implementer)protocol)rawceZdZdZy)IPHeaderc ltjd|dd\ }|_|_|_}|_|_|_}}tj||_ tj||_ |dz|_ |dzdz dz|_ |dz|_|dzd k7|_|d zd k7|_y) Nz !BBHHHBBH4s4sii@ri )structunpacktostot_len fragment_idttlrchecksocket inet_ntoasaddrdaddrversionihlfragment_offset dont_fragmentmore_fragments)selfdata ihlversionfrag_offrrs 1/usr/lib/python3/dist-packages/twisted/pair/ip.py__init__zIPHeader.__init__s MM/49 5  H L    H M J  %%e, %%e, !D( $&1,2'&0%.!3&/14N)__name__ __module__ __qualname__r#r$r"rrs5r$rlceZdZdZdZdZy) IPProtocolci|_y)N)ipProtos)rs r"r#zIPProtocol.__init__/s  r$ctj|}|dkr td|tk\r td||jvrg|j|<|j|j |y)Nrz'Added protocol must be positive or zeroz"Added protocol must fit in 32 bits)rIRawDatagramProtocol TypeErrorMAX_SIZEr,append)rnumprotos r"addProtozIPProtocol.addProto2si((/ 7EF F (?@A A dmm #!#DMM#  c!!%(r$ct|}|jj|jdD]}|j |dd||j |j |j|j|j|j|j|j|j|j|j|jy)Nr(r )rpartialsourcedestrrrrrrrrrr)rr,getrdatagramReceivedrrrrrrrrrrr)rrr6r8r7rheaderr3s r"r:zIPProtocol.datagramReceived<s$]]&&v; E  " ""#Y||\\JJJJ".. & 6 6$22%44JJ #  r$N)r%r&r'r#r4r:r(r$r"r*r*-s)r$r*)__doc__rrzope.interfacertwisted.internetr twisted.pairrrr0IRawPacketProtocolAbstractDatagramProtocolr*r(r$r"rBsV3 &%55.  S # #$ 22 % r$