Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 61b8759

Browse files
SDCORE-76 : SMF changes to support UPF allocating UE address (#15)
1 parent ca64cb8 commit 61b8759

File tree

1 file changed

+63
-2
lines changed

1 file changed

+63
-2
lines changed

pfcpType/UPFunctionFeatures.go

+63-2
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,62 @@ const (
2525
UpFunctionFeaturesQuoac uint16 = 1 << 11
2626
UpFunctionFeaturesTrace uint16 = 1 << 12
2727
UpFunctionFeaturesFrrt uint16 = 1 << 13
28+
UpFunctionFeaturesPfde uint16 = 1 << 14
29+
UpFunctionFeaturesEpfar uint16 = 1 << 15
30+
)
31+
32+
//Supported Feature-1
33+
const (
34+
UpFunctionFeatures1Dprda uint16 = 1
35+
UpFunctionFeatures1Adpdp uint16 = 1 << 1
36+
UpFunctionFeatures1Ueip uint16 = 1 << 2
37+
UpFunctionFeatures1Sset uint16 = 1 << 3
38+
UpFunctionFeatures1Mnop uint16 = 1 << 4
39+
UpFunctionFeatures1Mte uint16 = 1 << 5
40+
UpFunctionFeatures1Bundl uint16 = 1 << 6
41+
UpFunctionFeatures1Gcom uint16 = 1 << 7
42+
UpFunctionFeatures1Mpas uint16 = 1 << 8
43+
UpFunctionFeatures1Rttl uint16 = 1 << 9
44+
UpFunctionFeatures1Vtime uint16 = 1 << 10
45+
UpFunctionFeatures1Norp uint16 = 1 << 11
46+
UpFunctionFeatures1Iptv uint16 = 1 << 12
47+
UpFunctionFeatures1Ip6pl uint16 = 1 << 13
48+
UpFunctionFeatures1Tscu uint16 = 1 << 14
49+
UpFunctionFeatures1Mptcp uint16 = 1 << 15
50+
)
51+
52+
//Supported Feature-2
53+
const (
54+
UpFunctionFeatures2Atsssll uint16 = 1
55+
UpFunctionFeatures2Qfqm uint16 = 1 << 1
56+
UpFunctionFeatures2Gpqm uint16 = 1 << 2
57+
UpFunctionFeatures2Mtedt uint16 = 1 << 3
58+
UpFunctionFeatures2Ciot uint16 = 1 << 4
59+
UpFunctionFeatures2Ethar uint16 = 1 << 5
60+
UpFunctionFeatures2Ddds uint16 = 1 << 6
61+
UpFunctionFeatures2Rds uint16 = 1 << 7
62+
UpFunctionFeatures2Rttwp uint16 = 1 << 8
2863
)
2964

3065
type UPFunctionFeatures struct {
3166
SupportedFeatures uint16
67+
SupportedFeatures1 uint16
68+
SupportedFeatures2 uint16
3269
}
3370

3471
func (u *UPFunctionFeatures) MarshalBinary() (data []byte, err error) {
3572
var idx uint16 = 0
3673
// Octet 5 to 6
37-
data = make([]byte, 2)
74+
data = make([]byte, 6)
3875
binary.LittleEndian.PutUint16(data[idx:], u.SupportedFeatures)
3976

77+
// Octet 7 to 8 : Additional Supported-Features 1
78+
idx = 2
79+
binary.LittleEndian.PutUint16(data[idx:], u.SupportedFeatures1)
80+
81+
/// Octet 9 to 10 : Additional Supported-Features 2
82+
idx = 4
83+
binary.LittleEndian.PutUint16(data[idx:], u.SupportedFeatures2)
4084
return data, nil
4185
}
4286

@@ -48,6 +92,23 @@ func (u *UPFunctionFeatures) UnmarshalBinary(data []byte) error {
4892
if length < idx+2 {
4993
return fmt.Errorf("Inadequate TLV length: %d", length)
5094
}
51-
u.SupportedFeatures = binary.LittleEndian.Uint16(data[idx : idx+2])
95+
if length >= 2 {
96+
u.SupportedFeatures = binary.LittleEndian.Uint16(data[idx : idx+2])
97+
return nil
98+
}
99+
100+
if length >= 4 {
101+
//Additional Supported-Features 1
102+
idx += 2
103+
u.SupportedFeatures1 = binary.LittleEndian.Uint16(data[idx : idx+2])
104+
return nil
105+
}
106+
107+
if length == 6 {
108+
//Additional Supported-Features 2
109+
idx += 2
110+
u.SupportedFeatures2 = binary.LittleEndian.Uint16(data[idx : idx+2])
111+
}
52112
return nil
53113
}
114+

0 commit comments

Comments
 (0)