diff options
author | Chris Koch <chrisko@google.com> | 2020-09-16 00:32:07 -0700 |
---|---|---|
committer | Chris K <c@chrisko.ch> | 2020-09-16 08:00:50 -0700 |
commit | 1fd14545ba2c382e2f3bf72f6dc2dd1e20a39d22 (patch) | |
tree | df355840e52cdf1da37fdd2f98e455d1c5209172 /dhcpv4/nclient4/ipv4.go | |
parent | a0be48d916fffb667bbc621f178d5f8e0a753633 (diff) |
nclient4: remove unused functions
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv4/nclient4/ipv4.go')
-rw-r--r-- | dhcpv4/nclient4/ipv4.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/dhcpv4/nclient4/ipv4.go b/dhcpv4/nclient4/ipv4.go index 6ab7628..2dffd29 100644 --- a/dhcpv4/nclient4/ipv4.go +++ b/dhcpv4/nclient4/ipv4.go @@ -95,17 +95,6 @@ const ( // ipv4AddressSize is the size, in bytes, of an IPv4 address. ipv4AddressSize = 4 - - // ipv4Version is the version of the ipv4 protocol. - ipv4Version = 4 -) - -var ( - // ipv4Broadcast is the broadcast address of the IPv4 protocol. - ipv4Broadcast = net.IP{0xff, 0xff, 0xff, 0xff} - - // ipv4Any is the non-routable IPv4 "any" meta address. - ipv4Any = net.IP{0, 0, 0, 0} ) // headerLength returns the value of the "header length" field of the ipv4 @@ -135,11 +124,6 @@ func (b ipv4) transportProtocol() transportProtocolNumber { return transportProtocolNumber(b.protocol()) } -// payload implements Network.payload. -func (b ipv4) payload() []byte { - return b[b.headerLength():][:b.payloadLength()] -} - // payloadLength returns the length of the payload portion of the ipv4 packet. func (b ipv4) payloadLength() uint16 { return b.totalLength() - uint16(b.headerLength()) @@ -167,18 +151,6 @@ func (b ipv4) setFlagsFragmentOffset(flags uint8, offset uint16) { binary.BigEndian.PutUint16(b[flagsFO:], v) } -/* -// setSourceAddress sets the "source address" field of the ipv4 header. -func (b ipv4) setSourceAddress(addr net.IP) { - copy(b[srcAddr:srcAddr+ipv4AddressSize], addr.To4()) -} - -// setDestinationAddress sets the "destination address" field of the ipv4 -// header. -func (b ipv4) setDestinationAddress(addr net.IP) { - copy(b[dstAddr:dstAddr+ipv4AddressSize], addr.To4()) -}*/ - // calculateChecksum calculates the checksum of the ipv4 header. func (b ipv4) calculateChecksum() uint16 { return checksum(b[:b.headerLength()], 0) @@ -247,31 +219,11 @@ func (b udp) length() uint16 { return binary.BigEndian.Uint16(b[udpLength:]) } -// setSourcePort sets the "source port" field of the udp header. -func (b udp) setSourcePort(port uint16) { - binary.BigEndian.PutUint16(b[udpSrcPort:], port) -} - -// setDestinationPort sets the "destination port" field of the udp header. -func (b udp) setDestinationPort(port uint16) { - binary.BigEndian.PutUint16(b[udpDstPort:], port) -} - // setChecksum sets the "checksum" field of the udp header. func (b udp) setChecksum(checksum uint16) { binary.BigEndian.PutUint16(b[udpchecksum:], checksum) } -// payload returns the data contained in the udp datagram. -func (b udp) payload() []byte { - return b[udpMinimumSize:] -} - -// checksum returns the "checksum" field of the udp header. -func (b udp) checksum() uint16 { - return binary.BigEndian.Uint16(b[udpchecksum:]) -} - // calculateChecksum calculates the checksum of the udp packet, given the total // length of the packet and the checksum of the network-layer pseudo-header // (excluding the total length) and the checksum of the payload. |