-
Notifications
You must be signed in to change notification settings - Fork 3
/
udp_windows.go
58 lines (45 loc) · 1.11 KB
/
udp_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// +build windows
package udpfacade
import (
"net"
"errors"
"time"
"github.com/google/gopacket"
)
// Transparent UDP connection
type UDPConn struct {
conn *net.IPConn
Src *net.UDPAddr
Dst *net.UDPAddr
}
// Mock implementation to prevent Windows build errors - this should be implemented later
func DialUDPFrom(src *net.UDPAddr, dst *net.UDPAddr) (*UDPConn, error) {
return nil, errors.New("transparent udp connection not implemented for windows")
}
func (c *UDPConn) Read(b []byte) (int, error) {
return -1, errors.New("cannot read from transparent udp connection")
}
func (c *UDPConn) Write(b []byte) (int, error) {
return -1, nil
}
func (c *UDPConn) Close() error {
return nil
}
func (c *UDPConn) LocalAddr() net.Addr {
return nil
}
func (c *UDPConn) RemoteAddr() net.Addr {
return nil
}
func (c *UDPConn) SetDeadline(t time.Time) error {
return nil
}
func (c *UDPConn) SetReadDeadline(t time.Time) error {
return nil
}
func (c *UDPConn) SetWriteDeadline(t time.Time) error {
return nil
}
func craftPacket(b []byte, p *gopacket.SerializeBuffer, src *net.UDPAddr, dst *net.UDPAddr) error {
return nil
}