diff options
author | Christopher Koch <c@chrisko.ch> | 2019-01-20 21:13:30 +0000 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2019-01-24 08:05:49 +0000 |
commit | a4a666c6477431358a1d6ed7b556398ed690ab5c (patch) | |
tree | d6b4c0e7a753db223d7d8b09569c4d028cff0f24 /dhcpv4/option_ip_address_lease_time.go | |
parent | c90ab10024ada840e24bb028a3405961e8e4c26a (diff) |
dhcpv4: getters instead of getters
From:
r := GetRouter(d.Options)
To:
r := d.Router()
Diffstat (limited to 'dhcpv4/option_ip_address_lease_time.go')
-rw-r--r-- | dhcpv4/option_ip_address_lease_time.go | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/dhcpv4/option_ip_address_lease_time.go b/dhcpv4/option_ip_address_lease_time.go index 6e09233..20ee2b8 100644 --- a/dhcpv4/option_ip_address_lease_time.go +++ b/dhcpv4/option_ip_address_lease_time.go @@ -36,19 +36,3 @@ func (d Duration) String() string { func OptIPAddressLeaseTime(d time.Duration) Option { return Option{Code: OptionIPAddressLeaseTime, Value: Duration(d)} } - -// GetIPAddressLeaseTime returns the IP address lease time in o, or the given -// default duration if not present. -// -// The IP address lease time option is described by RFC 2132, Section 9.2. -func GetIPAddressLeaseTime(o Options, def time.Duration) time.Duration { - v := o.Get(OptionIPAddressLeaseTime) - if v == nil { - return def - } - var d Duration - if err := d.FromBytes(v); err != nil { - return def - } - return time.Duration(d) -} |