java - Creating IPv6 Header -
does have ipv6 ip header (40 bytes) created in java? have ipv4 header created.
/** * creates ip header given sip packet * length of ip header 20 octets. below information shall stored in each octet: * octet-0 - 0x45 (version , length) * octet-1 - 0x00 (type of service) * octet-2 - upper byte of length of ip header , data * octet-3 - lower byte of length of ip header , data * octet-4 - 0x00 (upper byte of identification) * octet-5 - 0x00 (lower byte of identification) * octet-6 - 0x00 (flag) * octet-7 - 0x00 (fragment offset) * octet-8 - 0x80 (time live) * octet-9 - 0x11 (protocol udp) * octet-10 - upper byte of checksum * octet-11 - lower byte of checksum * octet-12 - source ip address * octet-13 - source ip address * octet-14 - source ip address * octet-15 - source ip address * octet-16 - destination ip address * octet-17 - destination ip address * octet-18 - destination ip address * octet-19 - destination ip address */
maybe wikipedia article help?
i don't know java syntax, c struct notation, like:
struct ipv6_header { unsigned int version : 4, traffic_class : 8, flow_label : 20; uint16_t length; uint8_t next_header; uint8_t hop_limit; struct in6_addr src; struct in6_addr dst; };
i think, can pretty simple translate onto language.
Comments
Post a Comment