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

Commit 5e75149

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

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

message.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,9 @@ type PFCPSessionEstablishmentResponse struct {
354354
}
355355

356356
type CreatedPDR struct {
357-
PDRID *pfcpType.PacketDetectionRuleID `tlv:"56"`
358-
LocalFTEID *pfcpType.FTEID `tlv:"21"`
357+
PDRID *pfcpType.PacketDetectionRuleID `tlv:"56"`
358+
LocalFTEID *pfcpType.FTEID `tlv:"21"`
359+
UEIPAddress *pfcpType.UEIPAddress `tlv:"93"`
359360
}
360361

361362
type LoadControlInformation struct {

pfcpType/UEIPAddress.go

+12-5
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@ import (
1111
)
1212

1313
type UEIPAddress struct {
14-
Ipv6d bool
15-
Sd bool
16-
V4 bool
17-
V6 bool
14+
Ipv6d bool //bit 4
15+
Sd bool //bit 3
16+
V4 bool //bit 2
17+
V6 bool //bit 1
18+
CHV4 bool //bit 5
19+
CHV6 bool //bit 6
1820
Ipv4Address net.IP
1921
Ipv6Address net.IP
2022
Ipv6PrefixDelegationBits uint8
2123
}
2224

2325
func (u *UEIPAddress) MarshalBinary() (data []byte, err error) {
2426
// Octet 5
25-
tmpUint8 := btou(u.Ipv6d)<<3 |
27+
tmpUint8 := btou(u.CHV6)<<5 |
28+
btou(u.CHV4)<<4 |
29+
btou(u.Ipv6d)<<3 |
2630
btou(u.Sd)<<2 |
2731
btou(u.V4)<<1 |
2832
btou(u.V6)
@@ -60,6 +64,9 @@ func (u *UEIPAddress) UnmarshalBinary(data []byte) error {
6064
if length < idx+1 {
6165
return fmt.Errorf("Inadequate TLV length: %d", length)
6266
}
67+
68+
u.CHV6 = utob(uint8(data[idx]) & BitMask6)
69+
u.CHV4 = utob(uint8(data[idx]) & BitMask5)
6370
u.Ipv6d = utob(uint8(data[idx]) & BitMask4)
6471
u.Sd = utob(uint8(data[idx]) & BitMask3)
6572
u.V4 = utob(uint8(data[idx]) & BitMask2)

0 commit comments

Comments
 (0)