further updates

This commit is contained in:
Pin
2023-03-20 23:29:49 -04:00
parent 643be473a2
commit 9812b17738
4 changed files with 89 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
package utils
import (
"github.com/google/gopacket/layers"
)
func basePacket(c* SocketCall) (layers.Ethernet, layers.IPv4, layers.UDP) {
eth := layers.Ethernet {
EthernetType: layers.EthernetTypeIPv4,
SrcMAC: c.Iface.HardwareAddr,
DstMAC: layers.EthernetBroadcast,
}
ip := layers.IPv4 {
Version: 4,
TTL: 64,
SrcIP: []byte{0, 0, 0, 0},
DstIP: []byte{255, 255, 255, 255},
Protocol: layers.IPProtocolUDP,
}
udp := layers.UDP {
SrcPort: 6868,
DstPort: 6767,
}
return eth, ip, udp
}