def test_build_sctp(self):
eth = ethernet.ethernet('00:aa:aa:aa:aa:aa', '00:bb:bb:bb:bb:bb',
ether.ETH_TYPE_IP)
ip4 = ipv4.ipv4(4, 5, 16, 0, 0, 2, 0, 64, inet.IPPROTO_SCTP, 0,
'192.168.1.1', '10.144.1.1')
pkt = eth / ip4 / self.sc
eth = pkt.get_protocol(ethernet.ethernet)
ok_(eth)
eq_(eth.ethertype, ether.ETH_TYPE_IP)
ip4 = pkt.get_protocol(ipv4.ipv4)
ok_(ip4)
eq_(ip4.proto, inet.IPPROTO_SCTP)
sc = pkt.get_protocol(sctp.sctp)
ok_(sc)
eq_(sc, self.sc)
评论列表
文章目录