From 726d19e8d1a7db7186f202a37c172c24524e19ae Mon Sep 17 00:00:00 2001 From: Junxiao Shi Date: Fri, 21 Jun 2024 13:02:43 +0000 Subject: [PATCH] js: GtpLocator --- cmd/ndndpdk-upf/upfconfig.go | 6 +++--- iface/ethface/gtp.go | 2 +- js/types/iface.ts | 34 ++++++++++++++++++++++++++++++++-- mk/install.sh | 1 + 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/cmd/ndndpdk-upf/upfconfig.go b/cmd/ndndpdk-upf/upfconfig.go index 8051a9308..6f663443c 100644 --- a/cmd/ndndpdk-upf/upfconfig.go +++ b/cmd/ndndpdk-upf/upfconfig.go @@ -41,19 +41,19 @@ func (cfg *UpfConfig) DefineFlags(flags []cli.Flag) []cli.Flag { }, &cli.StringFlag{ Name: "upf-n3", - Usage: "UPF N3/N9 IPv4 `address`", + Usage: "UPF N3 IPv4 `address`", Required: true, Action: cfg.saveIPv4(&cfg.upfIP), }, &cli.GenericFlag{ Name: "upf-mac", - Usage: "UPF N3/N9 MAC `address`", + Usage: "UPF N3 MAC `address`", Required: true, Destination: &cfg.upfMAC, }, &cli.IntFlag{ Name: "upf-vlan", - Usage: "UPF N3/N9 `VLAN ID`", + Usage: "UPF N3 `VLAN ID`", Destination: &cfg.upfVLAN, }, &cli.StringSliceFlag{ diff --git a/iface/ethface/gtp.go b/iface/ethface/gtp.go index 490996bbf..16ef66c86 100644 --- a/iface/ethface/gtp.go +++ b/iface/ethface/gtp.go @@ -17,7 +17,7 @@ var ( const schemeGtp = "gtp" -// VxlanLocator describes a GTP-U face. +// GtpLocator describes a GTP-U face. type GtpLocator struct { IPLocator diff --git a/js/types/iface.ts b/js/types/iface.ts index 50094a3d0..986d2e7ad 100644 --- a/js/types/iface.ts +++ b/js/types/iface.ts @@ -12,7 +12,7 @@ export type FaceID = Uint; * Face locator. * @see */ -export type FaceLocator = EtherLocator | UdpLocator | VxlanLocator | MemifLocator | SocketFaceLocator; +export type FaceLocator = EtherLocator | UdpLocator | VxlanLocator | GtpLocator | MemifLocator | SocketFaceLocator; /** * Face configuration. @@ -125,7 +125,6 @@ export interface VxlanLocator extends IpLocatorBase { scheme: "vxlan"; /** - * @minimum 0 * @maximum 16777215 */ vxlan: Uint; @@ -134,6 +133,37 @@ export interface VxlanLocator extends IpLocatorBase { innerRemote: string; } +/** + * GTP-U face locator. + * @see + */ +export interface GtpLocator extends IpLocatorBase { + scheme: "gtp"; + + /** + * @maximum 4294967295 + */ + ulTEID: Uint; + + /** + * @maximum 63 + */ + ulQFI: Uint; + + /** + * @maximum 4294967295 + */ + dlTEID: Uint; + + /** + * @maximum 63 + */ + dlQFI: Uint; + + innerLocalIP: string; + innerRemoteIP: string; +} + export type MemifRole = "server" | "client"; /** diff --git a/mk/install.sh b/mk/install.sh index 8c3255bb2..300fb16e5 100755 --- a/mk/install.sh +++ b/mk/install.sh @@ -12,6 +12,7 @@ install -m0755 build/bin/ndndpdk-godemo "$DESTBIN/" install -m0755 build/bin/ndndpdk-hrlog2histogram "$DESTBIN/" install -m0755 build/bin/ndndpdk-jrproxy "$DESTBIN/" install -m0755 build/bin/ndndpdk-svc "$DESTBIN/" +install -m0755 build/bin/ndndpdk-upf "$DESTBIN/" install -d -m0755 "$DESTSHARE" install -m0644 build/share/ndn-dpdk/* "$DESTSHARE/"