summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/bsdp/client.go
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2019-01-28 00:53:04 +0000
committerinsomniac <insomniacslk@users.noreply.github.com>2019-01-28 11:21:18 +0000
commit51ac989e85d13beda9cb304fb85e0aff18e9cd98 (patch)
tree335f5968c0d0c55a5c8e1a65e997a0d331c2210a /dhcpv4/bsdp/client.go
parent82434691f0602844a2156a4d2037d43c51900b73 (diff)
dhcpv4: moved client into dhcpv4/client4
Diffstat (limited to 'dhcpv4/bsdp/client.go')
-rw-r--r--dhcpv4/bsdp/client.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/dhcpv4/bsdp/client.go b/dhcpv4/bsdp/client.go
index e8ca2ca..173291e 100644
--- a/dhcpv4/bsdp/client.go
+++ b/dhcpv4/bsdp/client.go
@@ -4,18 +4,19 @@ import (
"errors"
"github.com/insomniacslk/dhcp/dhcpv4"
+ "github.com/insomniacslk/dhcp/dhcpv4/client4"
)
// Client represents a BSDP client that can perform BSDP exchanges via the
// broadcast address.
type Client struct {
- dhcpv4.Client
+ client4.Client
}
// NewClient constructs a new client with default read and write timeouts from
// dhcpv4.Client.
func NewClient() *Client {
- return &Client{Client: dhcpv4.Client{}}
+ return &Client{Client: client4.Client{}}
}
// Exchange runs a full BSDP exchange (Inform[list], Ack, Inform[select],
@@ -24,17 +25,17 @@ func (c *Client) Exchange(ifname string) ([]*Packet, error) {
conversation := make([]*Packet, 0)
// Get our file descriptor for the broadcast socket.
- sendFd, err := dhcpv4.MakeBroadcastSocket(ifname)
+ sendFd, err := client4.MakeBroadcastSocket(ifname)
if err != nil {
return conversation, err
}
- recvFd, err := dhcpv4.MakeListeningSocket(ifname)
+ recvFd, err := client4.MakeListeningSocket(ifname)
if err != nil {
return conversation, err
}
// INFORM[LIST]
- informList, err := NewInformListForInterface(ifname, dhcpv4.ClientPort)
+ informList, err := NewInformListForInterface(ifname, client4.ClientPort)
if err != nil {
return conversation, err
}
@@ -59,7 +60,7 @@ func (c *Client) Exchange(ifname string) ([]*Packet, error) {
}
// INFORM[SELECT]
- informSelect, err := InformSelectForAck(PacketFor(ackForList), dhcpv4.ClientPort, bootImages[0])
+ informSelect, err := InformSelectForAck(PacketFor(ackForList), client4.ClientPort, bootImages[0])
if err != nil {
return conversation, err
}