diff --git a/common/protocol/headers.go b/common/protocol/headers.go index f4ad33ad6..c8ef3bf32 100644 --- a/common/protocol/headers.go +++ b/common/protocol/headers.go @@ -3,6 +3,7 @@ package protocol import ( "runtime" + "v2ray.com/core/common/buf" "v2ray.com/core/common/net" "v2ray.com/core/common/uuid" ) @@ -116,3 +117,26 @@ func (v *SecurityConfig) AsSecurity() Security { } return NormSecurity(Security(v.Type)) } + +type SessionFrameOption byte + +const ( + SessionFrameOptionDefault SessionFrameOption = 0x00 + SessionFrameOptionNew SessionFrameOption = 0x01 + SessionFrameOptionContinue SessionFrameOption = 0x02 + SessionFrameOptionEnd SessionFrameOption = 0x03 +) + +type SessionId uint32 + +const ( + DefaultSessionId SessionId = 0 +) + +type SessionFrame struct { + Id SessionId + Option SessionFrameOption + Address net.Address + Port net.Port + Payload *buf.Buffer +}