This question is probably very easy for most of you, but i cant find the answer so far.
I'm building a network packet generator that goes like this:
class PacketHeader(Packet):
fields = OrderedDict([
("head", "\x00"),
("headpad", "\x00"),
("headlen", "\x1a\x00" ),
("presentflag", "\x2e"),
("timestamp", "\x43\x10\x58\x16\xa1\x01\x00\x00"),
("flag", "\x03"),
("Sequencenum", "\x04\x00"),
])
Later, I call my class and send the packet like this:
send(PacketHeader(Sequencenum=257))
send(PacketHeader(Sequencenum=258))
send(PacketHeader(Sequencenum=259))
Unfortunatly, on the wire i have \x32\x35\x37 (257 in hex) instead of having this :\x01\x01.
What i would like to do, is being able to:
send(PacketHeader(Sequencenum=257+1))
and have it converted to int correctly on the wire
Thanks in advance !