Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UPF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UPF
Commits
47257bd9
Commit
47257bd9
authored
Apr 13, 2021
by
wangyongshou
Browse files
Options
Browse Files
Download
Plain Diff
resolve compile error
parents
84cee680
1de0f59c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
src/upf-n4/pkg/upf/controller/server.go
src/upf-n4/pkg/upf/controller/server.go
+17
-5
No files found.
src/upf-n4/pkg/upf/controller/server.go
View file @
47257bd9
...
...
@@ -137,6 +137,12 @@ func handleHeartBeatMsg(msgContent message.Message) []byte {
func
handleSessionEstablishmentMsg
(
config
*
conf
.
Config
,
msgContent
message
.
Message
)
[]
byte
{
msg
,
ok
:=
msgContent
.
(
*
message
.
SessionEstablishmentRequest
)
defer
func
()
{
err
:=
recover
()
if
err
!=
nil
{
log
.
Error
(
"Panicing %s
\n
"
,
err
)
}
}()
if
!
ok
{
log
.
Warn
(
"got unexpected message: "
+
msg
.
MessageTypeName
())
...
...
@@ -160,9 +166,9 @@ func handleSessionEstablishmentMsg(config *conf.Config, msgContent message.Messa
sourceInterface
,
_
:=
pdiIEs
[
0
]
.
SourceInterface
()
//fteid, _ := pdiIEs[1].FTEID()
ueipaddress
,
_
:=
pdiIEs
[
2
]
.
UEIPAddress
()
farid
,
_
:=
createPDR
[
3
]
.
FARID
()
createFAR
,
_
:=
msg
.
CreateFAR
[
0
]
.
CreateFAR
()
farid
,
_
:=
createFAR
[
0
]
.
FARID
()
applyAction
,
_
:=
createFAR
[
1
]
.
ApplyAction
()
forwardingParameters
,
_
:=
createFAR
[
2
]
.
ForwardingParameters
()
destinationInterface
,
_
:=
forwardingParameters
[
0
]
.
DestinationInterface
()
...
...
@@ -193,6 +199,7 @@ func handleSessionEstablishmentMsg(config *conf.Config, msgContent message.Messa
Flags
:
1
,
Teid
:
ueUpTeid
[
ueipaddress
.
IPv4Address
.
String
()],
IP
:
upf
.
BuptNodeValueIP4
(
ip4ToUint
(
config
.
Gnb
)),
//IP: upf.BuptNodeValueIP4([4]uint8{192, 168, 2, 137}),
},
UeAddr
:
upf
.
BuptPfcpUeIPAddress
{
Flags
:
2
,
...
...
@@ -244,6 +251,12 @@ func handleSessionEstablishmentMsg(config *conf.Config, msgContent message.Messa
func
handleSessionModificationMsg
(
config
*
conf
.
Config
,
msgContent
message
.
Message
)
[]
byte
{
msg
,
ok
:=
msgContent
.
(
*
message
.
SessionModificationRequest
)
defer
func
()
{
err
:=
recover
()
if
err
!=
nil
{
log
.
Error
(
"Panicing %s
\n
"
,
err
)
}
}()
if
!
ok
{
log
.
Warn
(
"got unexpected message: "
+
msg
.
MessageTypeName
())
...
...
@@ -258,7 +271,6 @@ func handleSessionModificationMsg(config *conf.Config, msgContent message.Messag
pdrid
,
_
:=
createPDR
[
0
]
.
PacketDetectionRuleID
()
pdiIEs
,
_
:=
createPDR
[
2
]
.
PDI
()
ueipaddress
,
_
:=
pdiIEs
[
1
]
.
UEIPAddress
()
modReqIP
=
ueipaddress
.
IPv4Address
.
String
()
// set ueip into seid
...
...
@@ -274,7 +286,6 @@ func handleSessionModificationMsg(config *conf.Config, msgContent message.Messag
log
.
Info
(
"SEID:%d"
,
msg
.
SEID
())
log
.
Info
(
"TEID 0x%x"
,
outerHeaderCreation
.
TEID
)
log
.
Info
(
"UE IP: %s"
,
ueSeid
[
msg
.
SEID
()])
log
.
Info
(
"PDR ID: %d"
,
pdrid
)
log
.
Info
(
"FAR ID:%d"
,
farid
)
log
.
Info
(
"UE IPv4:%s"
,
ueIP
)
log
.
Info
(
"GNB GTPU IP:%s"
,
gnbIP
)
...
...
@@ -287,7 +298,7 @@ func handleSessionModificationMsg(config *conf.Config, msgContent message.Messag
Teid
:
outerHeaderCreation
.
TEID
,
PdrID
:
uint32
(
pdrid
),
Ueip
:
IPToUInt32
(
net
.
ParseIP
(
modReqIP
)),
FarID
:
uint16
(
1
),
FarID
:
uint16
(
farid
),
GnbIP
:
IPToUInt32
(
net
.
ParseIP
(
gnbIP
)),
Port
:
uint16
(
2152
),
}
...
...
@@ -317,6 +328,7 @@ func handleSessionModificationMsg(config *conf.Config, msgContent message.Messag
log
.
Info
(
"pdrid: %d"
,
farid
)
log
.
Info
(
"ueip %s:index %d"
,
ueip
,
updateUeIndex
[
ueip
])
log
.
Info
(
"TEID 0x%x"
,
outerHeaderCreation
.
TEID
)
log
.
Info
(
"GNB GTPu: %s"
,
outerHeaderCreation
.
IPv4Address
.
String
())
req
:=
&
upf
.
UpfSsmReq
{
CpSeid
:
msg
.
SEID
(),
...
...
@@ -332,7 +344,7 @@ func handleSessionModificationMsg(config *conf.Config, msgContent message.Messag
FTeid
:
upf
.
BuptPfcpFTeid
{
Flags
:
1
,
Teid
:
outerHeaderCreation
.
TEID
,
IP
:
upf
.
BuptNodeValueIP4
(
ip4ToUint
(
config
.
Gnb
)),
IP
:
upf
.
BuptNodeValueIP4
(
ip4ToUint
(
outerHeaderCreation
.
IPv4Address
.
String
()
)),
},
UeAddr
:
upf
.
BuptPfcpUeIPAddress
{
Flags
:
2
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment