Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lease ¶
type Lease struct {
//IP address given to the lease
IP net.IP `json:"ip"`
//Start time of the lease
Starts time.Time `json:"starts"`
//Time when the lease expires
Ends time.Time `json:"ends"`
//Tstp is specified if the failover protocol is being used, and indicates what time the peer has been told the lease expires.
Tstp time.Time `json:"tstp"`
//Tsfp is also specified if the failover protocol is being used, and indicates the lease expiry time that the peer has acknowledged
Tsfp time.Time `json:"tsfp"`
//Atsfp is the actual time sent from the failover partner
Atsfp time.Time `json:"atsfp"`
//Cltt is the client's last transaction time
Cltt time.Time `json:"cllt"`
/*The binding state statement declares the lease's binding state. When the DHCP server is
not configured to use the failover protocol, a lease's binding state will be either
active or free. The failover protocol adds some additional transitional states, as
well as the backup state, which indicates that the lease is available for allocation
by the failover secondary.*/
BindingState string `json:"binding-state"`
//The next binding state statement indicates what state the lease will move to when the current state expires. The time when the current state expires is specified in the ends statement.
NextBindingState string `json:"next-binding-state"`
//The hardware statement records the MAC address of the network interface on which the lease will be used. It is specified as a series of hexadecimal octets, separated by colons.
Hardware struct {
Hardware string `json:"hardware"`
MAC string `json:"mac"`
MACAddr net.HardwareAddr `json:"-"`
} `json:"hardware"`
//The uid statement records the client identifier used by the client to acquire the lease. Clients are not required to send client identifiers, and this statement only appears if the client did in fact send one. Client identifiers are normally an ARP type (1 for ethernet) followed by the MAC address, just like in the hardware statement, but this is not required.
UID string `json:"uid"`
//Clients provided hostname
ClientHostname string `json:"client-hostname"`
}
Lease format specified in man(5) dhcpd.leases
- See https://linux.die.net/man/5/dhcpd.leases or similar
A Lease contains the data specified in the following format:
172.24.43.3 {
starts 6 2019/04/27 03:24:45;
ends 6 2019/04/27 03:34:45;
tstp 6 2019/04/27 03:34:45;
cltt 6 2019/04/27 03:24:45;
binding state free;
hardware ethernet 00:db:70:c3:11:d7;
uid "\001\000\333p\303\021\327";
}
Click to show internal directories.
Click to hide internal directories.