MCPcopy
hub / github.com/purpleidea/mgmt / DHCPHostRes

Struct DHCPHostRes

engine/resources/dhcp.go:1047–1089  ·  view source on GitHub ↗

DHCPHostRes is a representation of a static host assignment in DHCP.

Source from the content-addressed store, hash-verified

1045
1046// DHCPHostRes is a representation of a static host assignment in DHCP.
1047type DHCPHostRes struct {
1048 traits.Base // add the base methods without re-implementation
1049 //traits.Edgeable // XXX: add autoedge support
1050 traits.Groupable // can be grouped into DHCPServerRes
1051
1052 init *engine.Init
1053
1054 // Server is the name of the dhcp server resource to group this into. If
1055 // it is omitted, and there is only a single dhcp resource, then it will
1056 // be grouped into it automatically. If there is more than one main dhcp
1057 // resource being used, then the grouping behaviour is *undefined* when
1058 // this is not specified, and it is not recommended to leave this blank!
1059 Server string `lang:"server" yaml:"server"`
1060
1061 // Mac is the mac address of the host in lower case and separated with
1062 // colons.
1063 Mac string `lang:"mac" yaml:"mac"`
1064
1065 // IP is the IPv4 address with the CIDR suffix. The suffix is required
1066 // because it specifies the netmask to be used in the DHCPv4 protocol.
1067 // For example, you might specify 192.0.2.42/24 which represents a mask
1068 // of 255.255.255.0 that will be sent.
1069 IP string `lang:"ip" yaml:"ip"`
1070
1071 // NBP is the network boot program URL. This is used for the tftp server
1072 // name and the boot file name. For example, you might use:
1073 // tftp://192.0.2.13/pxelinux.0 for a common bios, pxe boot setup. Note
1074 // that the "scheme" prefix is required, and that it's impossible to
1075 // specify a file that doesn't begin with a leading slash. If you wish
1076 // to specify a "root less" file (common for legacy tftp setups) then
1077 // you can use this feature in conjunction with the NBPPath parameter.
1078 // For DHCPv4, the scheme must be "tftp".
1079 NBP string `lang:"nbp" yaml:"nbp"`
1080
1081 // NBPPath overrides the path that is sent for the nbp protocols. By
1082 // default it is taken from parsing a URL in NBP, but this can override
1083 // that. This is useful if you require a path that doesn't start with a
1084 // slash. This is sometimes desirable for legacy tftp setups.
1085 NBPPath string `lang:"nbp_path" yaml:"nbp_path"`
1086
1087 ipv4Addr net.IP // XXX: port to netip.Addr
1088 ipv4Mask net.IPMask
1089}
1090
1091// Default returns some sensible defaults for this resource.
1092func (obj *DHCPHostRes) Default() engine.Res {

Callers 1

UnmarshalYAMLMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected