summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dhcpv4/bsdp/bsdp_option_boot_image_list.go2
-rw-r--r--dhcpv4/bsdp/bsdp_option_server_identifier.go2
-rw-r--r--dhcpv4/option_archtype.go5
-rw-r--r--dhcpv4/option_bootfile_name.go6
-rw-r--r--dhcpv4/option_broadcast_address.go6
-rw-r--r--dhcpv4/option_class_identifier.go6
-rw-r--r--dhcpv4/option_domain_name.go10
-rw-r--r--dhcpv4/option_domain_search.go10
-rw-r--r--dhcpv4/option_host_name.go6
-rw-r--r--dhcpv4/option_ip_address_lease_time.go6
-rw-r--r--dhcpv4/option_ips.go12
-rw-r--r--dhcpv4/option_maximum_dhcp_message_size.go10
-rw-r--r--dhcpv4/option_message_type.go6
-rw-r--r--dhcpv4/option_parameter_request_list.go6
-rw-r--r--dhcpv4/option_relay_agent_information.go7
-rw-r--r--dhcpv4/option_requested_ip_address.go7
-rw-r--r--dhcpv4/option_root_path.go6
-rw-r--r--dhcpv4/option_server_identifier.go6
-rw-r--r--dhcpv4/option_subnet_mask.go6
-rw-r--r--dhcpv4/option_tftp_server_name.go6
-rw-r--r--dhcpv4/option_userclass.go5
-rw-r--r--dhcpv4/option_vivc.go6
22 files changed, 48 insertions, 94 deletions
diff --git a/dhcpv4/bsdp/bsdp_option_boot_image_list.go b/dhcpv4/bsdp/bsdp_option_boot_image_list.go
index e67cb46..3282fa3 100644
--- a/dhcpv4/bsdp/bsdp_option_boot_image_list.go
+++ b/dhcpv4/bsdp/bsdp_option_boot_image_list.go
@@ -5,8 +5,6 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// Implements the BSDP option listing the boot images.
-
// OptBootImageList contains the list of boot images presented by a netboot
// server.
type OptBootImageList struct {
diff --git a/dhcpv4/bsdp/bsdp_option_server_identifier.go b/dhcpv4/bsdp/bsdp_option_server_identifier.go
index 8f2c41a..d1f5b6c 100644
--- a/dhcpv4/bsdp/bsdp_option_server_identifier.go
+++ b/dhcpv4/bsdp/bsdp_option_server_identifier.go
@@ -8,7 +8,7 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// OptServerIdentifier represents an option encapsulating the server identifier.
+// OptServerIdentifier implements the BSDP server identifier option.
type OptServerIdentifier struct {
ServerID net.IP
}
diff --git a/dhcpv4/option_archtype.go b/dhcpv4/option_archtype.go
index c475174..59dadb3 100644
--- a/dhcpv4/option_archtype.go
+++ b/dhcpv4/option_archtype.go
@@ -1,8 +1,5 @@
package dhcpv4
-// This option implements the Client System Architecture Type option
-// https://tools.ietf.org/html/rfc4578
-
import (
"fmt"
@@ -11,7 +8,7 @@ import (
)
// OptClientArchType represents an option encapsulating the Client System
-// Architecture Type option Definition.
+// Architecture Type option definition. See RFC 4578.
type OptClientArchType struct {
ArchTypes []iana.Arch
}
diff --git a/dhcpv4/option_bootfile_name.go b/dhcpv4/option_bootfile_name.go
index 9e55bc3..da0d873 100644
--- a/dhcpv4/option_bootfile_name.go
+++ b/dhcpv4/option_bootfile_name.go
@@ -4,10 +4,8 @@ import (
"fmt"
)
-// This option implements the Bootfile name Option.
-// https://tools.ietf.org/html/rfc2132
-
-// OptBootfileName implements the BootFile Name option
+// OptBootfileName implements the bootfile name option described in RFC 2132,
+// Section 9.5.
type OptBootfileName struct {
BootfileName string
}
diff --git a/dhcpv4/option_broadcast_address.go b/dhcpv4/option_broadcast_address.go
index c8bfe71..0f5fb4b 100644
--- a/dhcpv4/option_broadcast_address.go
+++ b/dhcpv4/option_broadcast_address.go
@@ -7,10 +7,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the server identifier option
-// https://tools.ietf.org/html/rfc2132
-
-// OptBroadcastAddress represents an option encapsulating the server identifier.
+// OptBroadcastAddress implements the broadcast address option described in RFC
+// 2132, Section 5.3.
type OptBroadcastAddress struct {
BroadcastAddress net.IP
}
diff --git a/dhcpv4/option_class_identifier.go b/dhcpv4/option_class_identifier.go
index 23394f0..286cb59 100644
--- a/dhcpv4/option_class_identifier.go
+++ b/dhcpv4/option_class_identifier.go
@@ -4,10 +4,8 @@ import (
"fmt"
)
-// This option implements the Class Identifier option
-// https://tools.ietf.org/html/rfc2132
-
-// OptClassIdentifier represents the DHCP message type option.
+// OptClassIdentifier implements the vendor class identifier option described
+// in RFC 2132, Section 9.13.
type OptClassIdentifier struct {
Identifier string
}
diff --git a/dhcpv4/option_domain_name.go b/dhcpv4/option_domain_name.go
index 456614d..932a1a4 100644
--- a/dhcpv4/option_domain_name.go
+++ b/dhcpv4/option_domain_name.go
@@ -2,16 +2,14 @@ package dhcpv4
import "fmt"
-// This option implements the domain name option
-// https://tools.ietf.org/html/rfc2132
-
-// OptDomainName represents an option encapsulating the domain name.
+// OptDomainName implements the domain name option described in RFC 2132,
+// Section 3.17.
type OptDomainName struct {
DomainName string
}
-// ParseOptDomainName returns a new OptDomainName from a byte
-// stream, or error if any.
+// ParseOptDomainName returns a new OptDomainName from a byte stream, or error
+// if any.
func ParseOptDomainName(data []byte) (*OptDomainName, error) {
return &OptDomainName{DomainName: string(data)}, nil
}
diff --git a/dhcpv4/option_domain_search.go b/dhcpv4/option_domain_search.go
index d4d1383..e352e34 100644
--- a/dhcpv4/option_domain_search.go
+++ b/dhcpv4/option_domain_search.go
@@ -1,18 +1,16 @@
package dhcpv4
-// This module defines the OptDomainSearch structure.
-// https://tools.ietf.org/html/rfc3397
-
import (
"fmt"
"github.com/insomniacslk/dhcp/rfc1035label"
)
-// FIXME rename OptDomainSearch to OptDomainSearchList, and DomainSearch to
+// OptDomainSearch implements the domain search list option described by RFC
+// 3397, Section 2.
+//
+// FIXME: rename OptDomainSearch to OptDomainSearchList, and DomainSearch to
// SearchList, for consistency with the equivalent v6 option
-
-// OptDomainSearch represents an option encapsulating a domain search list.
type OptDomainSearch struct {
DomainSearch *rfc1035label.Labels
}
diff --git a/dhcpv4/option_host_name.go b/dhcpv4/option_host_name.go
index 417fa6d..242ea22 100644
--- a/dhcpv4/option_host_name.go
+++ b/dhcpv4/option_host_name.go
@@ -2,10 +2,8 @@ package dhcpv4
import "fmt"
-// This option implements the host name option
-// https://tools.ietf.org/html/rfc2132
-
-// OptHostName represents an option encapsulating the host name.
+// OptHostName implements the host name option described by RFC 2132, Section
+// 3.14.
type OptHostName struct {
HostName string
}
diff --git a/dhcpv4/option_ip_address_lease_time.go b/dhcpv4/option_ip_address_lease_time.go
index f6a85c7..4362419 100644
--- a/dhcpv4/option_ip_address_lease_time.go
+++ b/dhcpv4/option_ip_address_lease_time.go
@@ -6,10 +6,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the IP Address Lease Time option
-// https://tools.ietf.org/html/rfc2132
-
-// OptIPAddressLeaseTime represents the IP Address Lease Time option.
+// OptIPAddressLeaseTime implements the IP address lease time option described
+// by RFC 2132, Section 9.2.
type OptIPAddressLeaseTime struct {
LeaseTime uint32
}
diff --git a/dhcpv4/option_ips.go b/dhcpv4/option_ips.go
index a14a68c..8792ed0 100644
--- a/dhcpv4/option_ips.go
+++ b/dhcpv4/option_ips.go
@@ -8,9 +8,6 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the router option
-// https://tools.ietf.org/html/rfc2132
-
// ParseIPs parses an IPv4 address from a DHCP packet as used and specified by
// options in RFC 2132, Sections 3.5 through 3.13, 8.2, 8.3, 8.5, 8.6, 8.9, and
// 8.10.
@@ -48,7 +45,7 @@ func IPsToString(i []net.IP) string {
return strings.Join(s, ", ")
}
-// OptRouter represents an option encapsulating the routers.
+// OptRouter implements the router option described by RFC 2132, Section 3.5.
type OptRouter struct {
Routers []net.IP
}
@@ -77,7 +74,8 @@ func (o *OptRouter) String() string {
return fmt.Sprintf("Routers -> %s", IPsToString(o.Routers))
}
-// OptNTPServers represents an option encapsulating the NTP servers.
+// OptNTPServers implements the NTP servers option described by RFC 2132,
+// Section 8.3.
type OptNTPServers struct {
NTPServers []net.IP
}
@@ -106,8 +104,8 @@ func (o *OptNTPServers) String() string {
return fmt.Sprintf("NTP Servers -> %v", IPsToString(o.NTPServers))
}
-// OptDomainNameServer represents an option encapsulating the domain name
-// servers.
+// OptDomainNameServer implements the DNS server option described by RFC 2132,
+// Section 3.8.
type OptDomainNameServer struct {
NameServers []net.IP
}
diff --git a/dhcpv4/option_maximum_dhcp_message_size.go b/dhcpv4/option_maximum_dhcp_message_size.go
index b8a8213..904f3d2 100644
--- a/dhcpv4/option_maximum_dhcp_message_size.go
+++ b/dhcpv4/option_maximum_dhcp_message_size.go
@@ -6,16 +6,14 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the Maximum DHCP Message size option
-// https://tools.ietf.org/html/rfc2132
-
-// OptMaximumDHCPMessageSize represents the Maximum DHCP Message size option.
+// OptMaximumDHCPMessageSize implements the maximum DHCP message size option
+// described by RFC 2132, Section 9.10.
type OptMaximumDHCPMessageSize struct {
Size uint16
}
-// ParseOptMaximumDHCPMessageSize constructs an OptMaximumDHCPMessageSize struct from a sequence of
-// bytes and returns it, or an error.
+// ParseOptMaximumDHCPMessageSize constructs an OptMaximumDHCPMessageSize
+// struct from a sequence of bytes and returns it, or an error.
func ParseOptMaximumDHCPMessageSize(data []byte) (*OptMaximumDHCPMessageSize, error) {
buf := uio.NewBigEndianBuffer(data)
return &OptMaximumDHCPMessageSize{Size: buf.Read16()}, buf.FinError()
diff --git a/dhcpv4/option_message_type.go b/dhcpv4/option_message_type.go
index 501394c..2857e41 100644
--- a/dhcpv4/option_message_type.go
+++ b/dhcpv4/option_message_type.go
@@ -6,10 +6,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the message type option
-// https://tools.ietf.org/html/rfc2132
-
-// OptMessageType represents the DHCP message type option.
+// OptMessageType implements the DHCP message type option described by RFC
+// 2132, Section 9.6.
type OptMessageType struct {
MessageType MessageType
}
diff --git a/dhcpv4/option_parameter_request_list.go b/dhcpv4/option_parameter_request_list.go
index c246f5c..d82f1ea 100644
--- a/dhcpv4/option_parameter_request_list.go
+++ b/dhcpv4/option_parameter_request_list.go
@@ -7,10 +7,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the parameter request list option
-// https://tools.ietf.org/html/rfc2132
-
-// OptParameterRequestList represents the parameter request list option.
+// OptParameterRequestList implements the parameter request list option
+// described by RFC 2132, Section 9.8.
type OptParameterRequestList struct {
RequestedOpts []OptionCode
}
diff --git a/dhcpv4/option_relay_agent_information.go b/dhcpv4/option_relay_agent_information.go
index 4b93bdd..42625ca 100644
--- a/dhcpv4/option_relay_agent_information.go
+++ b/dhcpv4/option_relay_agent_information.go
@@ -6,11 +6,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the relay agent information option
-// https://tools.ietf.org/html/rfc3046
-
-// OptRelayAgentInformation is a "container" option for specific agent-supplied
-// sub-options.
+// OptRelayAgentInformation implements the relay agent info option described by
+// RFC 3046.
type OptRelayAgentInformation struct {
Options Options
}
diff --git a/dhcpv4/option_requested_ip_address.go b/dhcpv4/option_requested_ip_address.go
index d3e565d..bd3bc09 100644
--- a/dhcpv4/option_requested_ip_address.go
+++ b/dhcpv4/option_requested_ip_address.go
@@ -7,11 +7,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the requested IP address option
-// https://tools.ietf.org/html/rfc2132
-
-// OptRequestedIPAddress represents an option encapsulating the server
-// identifier.
+// OptRequestedIPAddress implements the requested IP address option described
+// by RFC 2132, Section 9.1.
type OptRequestedIPAddress struct {
RequestedAddr net.IP
}
diff --git a/dhcpv4/option_root_path.go b/dhcpv4/option_root_path.go
index 84e392e..66a55a7 100644
--- a/dhcpv4/option_root_path.go
+++ b/dhcpv4/option_root_path.go
@@ -4,10 +4,8 @@ import (
"fmt"
)
-// This option implements the root path option
-// https://tools.ietf.org/html/rfc2132
-
-// OptRootPath represents the path to the client's root disk.
+// OptRootPath implements the root path option described by RFC 2132, Section
+// 3.19.
type OptRootPath struct {
Path string
}
diff --git a/dhcpv4/option_server_identifier.go b/dhcpv4/option_server_identifier.go
index cc5e1a5..6fc09a9 100644
--- a/dhcpv4/option_server_identifier.go
+++ b/dhcpv4/option_server_identifier.go
@@ -7,10 +7,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// OptServerIdentifier represents an option encapsulating the server identifier.
-//
-// This option implements the server identifier option
-// https://tools.ietf.org/html/rfc2132
+// OptServerIdentifier implements the server identifier option described by RFC
+// 2132, Section 9.7.
type OptServerIdentifier struct {
ServerID net.IP
}
diff --git a/dhcpv4/option_subnet_mask.go b/dhcpv4/option_subnet_mask.go
index 037a0ad..19401d8 100644
--- a/dhcpv4/option_subnet_mask.go
+++ b/dhcpv4/option_subnet_mask.go
@@ -7,10 +7,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the subnet mask option
-// https://tools.ietf.org/html/rfc2132
-
-// OptSubnetMask represents an option encapsulating the subnet mask.
+// OptSubnetMask implements the subnet mask option described by RFC 2132,
+// Section 3.3.
type OptSubnetMask struct {
SubnetMask net.IPMask
}
diff --git a/dhcpv4/option_tftp_server_name.go b/dhcpv4/option_tftp_server_name.go
index 3daa2f5..52c638d 100644
--- a/dhcpv4/option_tftp_server_name.go
+++ b/dhcpv4/option_tftp_server_name.go
@@ -4,10 +4,8 @@ import (
"fmt"
)
-// This option implements the TFTP server name option.
-// https://tools.ietf.org/html/rfc2132
-
-// OptTFTPServerName implements the TFTP server name option.
+// OptTFTPServerName implements the TFTP server name option described by RFC
+// 2132, Section 9.4.
type OptTFTPServerName struct {
TFTPServerName string
}
diff --git a/dhcpv4/option_userclass.go b/dhcpv4/option_userclass.go
index 2e31846..110cb37 100644
--- a/dhcpv4/option_userclass.go
+++ b/dhcpv4/option_userclass.go
@@ -8,10 +8,7 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the User Class option
-// https://tools.ietf.org/html/rfc3004
-
-// OptUserClass represents an option encapsulating User Classes.
+// OptUserClass implements the user class option described by RFC 3004.
type OptUserClass struct {
UserClasses [][]byte
Rfc3004 bool
diff --git a/dhcpv4/option_vivc.go b/dhcpv4/option_vivc.go
index b0fe85d..b6efab9 100644
--- a/dhcpv4/option_vivc.go
+++ b/dhcpv4/option_vivc.go
@@ -7,10 +7,8 @@ import (
"github.com/u-root/u-root/pkg/uio"
)
-// This option implements the Vendor-Identifying Vendor Class Option
-// https://tools.ietf.org/html/rfc3925
-
-// VIVCIdentifier represents one Vendor-Identifying vendor class option.
+// VIVCIdentifier implements the vendor-identifying vendor class option
+// described by RFC 3925.
type VIVCIdentifier struct {
EntID uint32
Data []byte