assign port token for a udp packet

This commit is contained in:
V2Ray
2015-09-28 14:57:43 +02:00
parent b5fee0def0
commit ba3f6108b8
2 changed files with 59 additions and 3 deletions
+7 -1
View File
@@ -12,10 +12,11 @@ func NewTCPPacket(dest Destination) *TCPPacket {
}
}
func NewUDPPacket(dest Destination, data []byte) *UDPPacket {
func NewUDPPacket(dest Destination, data []byte, id uint16) *UDPPacket {
return &UDPPacket{
basePacket: basePacket{destination: dest},
data: data,
id: id,
}
}
@@ -42,6 +43,11 @@ func (packet *TCPPacket) MoreChunks() bool {
type UDPPacket struct {
basePacket
data []byte
id uint16
}
func (packet *UDPPacket) ID() uint16 {
return packet.id
}
func (packet *UDPPacket) Chunk() []byte {