osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/libgtpnl/+/34736?usp=email )
Change subject: add IPv6 API for GTP tunnel ...................................................................... add IPv6 API for GTP tunnel Extend existing API to allow to set family and IPv6 ms and sgsn address. Change-Id: Ic9c1a5cd791b285d214e7f2aeb76f8bf372e01c6 --- M include/libgtpnl/gtp.h M src/gtp.c M src/libgtpnl.map 3 files changed, 38 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libgtpnl refs/changes/36/34736/1 diff --git a/include/libgtpnl/gtp.h b/include/libgtpnl/gtp.h index a6cd8e2..b7b582b 100644 --- a/include/libgtpnl/gtp.h +++ b/include/libgtpnl/gtp.h @@ -9,10 +9,13 @@ struct gtp_tunnel *gtp_tunnel_alloc(void); void gtp_tunnel_free(struct gtp_tunnel *t); +void gtp_tunnel_set_family(struct gtp_tunnel *t, uint8_t family); void gtp_tunnel_set_ifns(struct gtp_tunnel *t, int ifns); void gtp_tunnel_set_ifidx(struct gtp_tunnel *t, uint32_t ifidx); void gtp_tunnel_set_ms_ip4(struct gtp_tunnel *t, struct in_addr *ms_addr); void gtp_tunnel_set_sgsn_ip4(struct gtp_tunnel *t, struct in_addr *sgsn_addr); +void gtp_tunnel_set_ms_ip6(struct gtp_tunnel *t, const struct in6_addr *ms_addr); +void gtp_tunnel_set_sgsn_ip6(struct gtp_tunnel *t, const struct in6_addr *sgsn_addr); void gtp_tunnel_set_version(struct gtp_tunnel *t, uint32_t version); void gtp_tunnel_set_tid(struct gtp_tunnel *t, uint64_t tid); void gtp_tunnel_set_i_tei(struct gtp_tunnel *t, uint32_t i_tei); diff --git a/src/gtp.c b/src/gtp.c index 05e3731..9952278 100644 --- a/src/gtp.c +++ b/src/gtp.c @@ -47,6 +47,12 @@ } EXPORT_SYMBOL(gtp_tunnel_free); +void gtp_tunnel_set_family(struct gtp_tunnel *t, uint8_t family) +{ + t->family = family; +} +EXPORT_SYMBOL(gtp_tunnel_set_family); + void gtp_tunnel_set_ifns(struct gtp_tunnel *t, int ifns) { t->ifns = ifns; @@ -71,6 +77,18 @@ } EXPORT_SYMBOL(gtp_tunnel_set_sgsn_ip4); +void gtp_tunnel_set_ms_ip6(struct gtp_tunnel *t, const struct in6_addr *ms_addr) +{ + t->ip6.ms_addr = *ms_addr; +} +EXPORT_SYMBOL(gtp_tunnel_set_ms_ip6); + +void gtp_tunnel_set_sgsn_ip6(struct gtp_tunnel *t, const struct in6_addr *sgsn_addr) +{ + t->ip6.sgsn_addr = *sgsn_addr; +} +EXPORT_SYMBOL(gtp_tunnel_set_sgsn_ip6); + void gtp_tunnel_set_version(struct gtp_tunnel *t, uint32_t version) { t->gtp_version = version; diff --git a/src/libgtpnl.map b/src/libgtpnl.map index 804f8b3..cfb1b20 100644 --- a/src/libgtpnl.map +++ b/src/libgtpnl.map @@ -38,3 +38,9 @@ local: *; }; + +LIBGTPNL_1.1 { + gtp_tunnel_set_family; + gtp_tunnel_set_ms_ip6; + gtp_tunnel_set_sgsn_ip6; +} LIBGTPNL_1.0; -- To view, visit https://gerrit.osmocom.org/c/libgtpnl/+/34736?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libgtpnl Gerrit-Branch: master Gerrit-Change-Id: Ic9c1a5cd791b285d214e7f2aeb76f8bf372e01c6 Gerrit-Change-Number: 34736 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osm...@sysmocom.de> Gerrit-MessageType: newchange