Skip to content

Commit

Permalink
Make server4 package compile on Windows
Browse files Browse the repository at this point in the history
The user can pass directly a net.PacketConn.
  • Loading branch information
guillaumerose committed May 25, 2021
1 parent 95b2ff6 commit 6488a06
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dhcpv4/server4/conn.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !windows

package server4

import (
Expand Down
10 changes: 10 additions & 0 deletions dhcpv4/server4/conn_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package server4

import (
"errors"
"net"
)

func NewIPv4UDPConn(iface string, addr *net.UDPAddr) (*net.UDPConn, error) {
return nil, errors.New("not implemented on Windows")
}
7 changes: 7 additions & 0 deletions interfaces/bindtodevice_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package interfaces

import "errors"

func BindToInterface(fd int, ifname string) error {
return errors.New("not implemented on Windows")
}

0 comments on commit 6488a06

Please sign in to comment.