2023-01-03 13:34:32 +01:00
|
|
|
package packet
|
2023-04-11 16:05:24 +02:00
|
|
|
|
|
|
|
import "gitea.mmo.to/ProtocolPacketForger/ppf/protocol"
|
|
|
|
|
2023-04-12 15:14:19 +02:00
|
|
|
// Layer implements protocol.ProtocolReferencer
|
|
|
|
type Layer struct {
|
2023-04-11 16:05:24 +02:00
|
|
|
// needs a reference to a protocol
|
|
|
|
protocolReference *protocol.ProtocolStructure
|
|
|
|
|
|
|
|
ProtocolName string
|
|
|
|
Values []FieldValue
|
|
|
|
}
|
|
|
|
|
2023-04-12 15:14:19 +02:00
|
|
|
// Structure contains all layers of a packet
|
|
|
|
type Structure struct {
|
|
|
|
MetaData Metadata
|
|
|
|
Layers []Layer
|
2023-04-11 16:05:24 +02:00
|
|
|
}
|
|
|
|
|
2023-04-12 15:14:19 +02:00
|
|
|
func (pl *Layer) GetProtocol() *protocol.ProtocolStructure {
|
2023-04-11 16:05:24 +02:00
|
|
|
return pl.protocolReference
|
|
|
|
}
|
|
|
|
|
2023-04-12 15:14:19 +02:00
|
|
|
func (pl *Layer) Setprotocol(ps *protocol.ProtocolStructure) {
|
2023-04-11 16:05:24 +02:00
|
|
|
pl.protocolReference = ps
|
|
|
|
}
|