pkt library

The pkt library provides function for accessing and manipulating network packets. It can be imported into a script as follows:

local pkt = require("pktizr.pkt")

The provided functions can then be used by prepending pkt. to the name (e.g. pkt.send(...)).

Functions

cookie16(saddr, daddr, sport, dport)

Returns a 16bit “cookie” value calculated from the source address, destination address, source port and destination port of a network packet, and a random number calculated at program startup.

cookie32(saddr, daddr, sport, dport)

Returns a 32bit “cookie” value calculated from the source address, destination address, source port and destination port of a network packet, and a random number calculated at program startup.

send(p1, p2, ...)

Packs and sneds the given packets on the network. The packets are stacked from left to right: p1 is stacked on the lower level, p2 on top of p1, etc.

Table Of Contents

Previous topic

bit library

Next topic

std library

This Page