Documentation
¶
Overview ¶
Package common provides common functions for Geneva.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateIPv4Checksum ¶
CalculateIPv4Checksum calculates the IPv4 checksum for the given bytes. copied from gopacket/layers/ip4.go because they didn't export one. for whatever some reason..
func UpdateIPv4Checksum ¶
UpdateIPv4Checksum updates the IPv4 checksum field and the raw bytes for a gopacket IPv4 layer.
func UpdateTCPChecksum ¶
UpdateTCPChecksum updates the TCP checksum field and the raw bytes for a gopacket TCP layer.
The TCP checksum covers a pseudo-header derived from the IPv4 source and destination addresses, so ip must be the TCP layer's network layer. A freshly decoded packet does not carry that association, which is why the caller passes it explicitly; without it ComputeChecksum fails and the checksum would be left zero. ip may be nil only when the TCP layer already has its network layer set.
Types ¶
This section is empty.