mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-21 19:13:20 +08:00
init
This commit is contained in:
27
gold/head/packet.go
Normal file
27
gold/head/packet.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package head
|
||||
|
||||
type Packet struct {
|
||||
Proto uint8
|
||||
SrcPort uint16
|
||||
DstPort uint16
|
||||
TTL uint8
|
||||
Data []byte
|
||||
}
|
||||
|
||||
func NewPacket(proto uint8, srcPort uint16, dstPort uint16, data []byte) *Packet {
|
||||
return &Packet{
|
||||
Proto: proto,
|
||||
SrcPort: srcPort,
|
||||
DstPort: dstPort,
|
||||
TTL: 255,
|
||||
Data: data,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Packet) UnMashal(data []byte) {
|
||||
|
||||
}
|
||||
|
||||
func (p *Packet) Mashal() []byte {
|
||||
return nil
|
||||
}
|
||||
7
gold/head/protos.go
Normal file
7
gold/head/protos.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package head
|
||||
|
||||
const (
|
||||
ProtoHello uint8 = iota
|
||||
ProtoHelloAck
|
||||
ProtoData
|
||||
)
|
||||
Reference in New Issue
Block a user