Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
oai-upf-6g
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
oai-upf-6g
Commits
ad9f9b6b
Commit
ad9f9b6b
authored
Apr 14, 2025
by
Franck Messaoudi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactore: use static inline function for the class_id calculation
parent
d22260a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
src/upf_app/bpf/rules/include/sdf_filter.h
src/upf_app/bpf/rules/include/sdf_filter.h
+14
-0
No files found.
src/upf_app/bpf/rules/include/sdf_filter.h
View file @
ad9f9b6b
...
@@ -8,6 +8,20 @@
...
@@ -8,6 +8,20 @@
//#include <linux/tcp.h>
//#include <linux/tcp.h>
//#include <linux/udp.h>
//#include <linux/udp.h>
/*---------------------------------------------------------------------------------------------------------------*/
static
inline
uint16_t
generate_minor_id
(
uint64_t
seid
,
uint8_t
qfi
)
{
uint16_t
hash
=
(
seid
^
(
seid
>>
16
)
^
(
seid
>>
32
)
^
(
seid
>>
48
));
uint16_t
minor_id
=
(
hash
+
(
qfi
*
37
))
&
0xFFFF
;
// Avoid modulo, use bitmask
// Limit minor_id to a max of 9999
minor_id
=
(
minor_id
>
9999
)
?
9999
:
minor_id
;
return
minor_id
?
minor_id
:
1
;
// Ensure nonzero
}
/*---------------------------------------------------------------------------------------------------------------*/
struct
ip_subnet
{
struct
ip_subnet
{
u8
type
;
u8
type
;
/*
/*
...
...
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