pespin has uploaded this change for review.
Use gtp_u_kmod to create a gtp tundev
Adding gtp_u_kmod app in osmo_epdg.app.src makes the module app started
and create gtp tunnel based on config file upon startup.
No other operation is done yet on the tunnel, but this step already
allows testing by manually creating pdp contexts outside of the app.
The module gtp_u_kmod currently creates the tundev interface with name
"gtp0" (hardcoded).
The module gtp_u_kmod will fail if the gtp tundev is already created, so
be sure to have it removed before starting osmo-epdg.
Change-Id: Ie7718e1b161477bd738fa75f803ab37e9f35121d
---
M config/sys.config
M debian/osmo-epdg.install
M rebar.config
M rebar.lock
M src/osmo_epdg.app.src
5 files changed, 67 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/43/35943/1
diff --git a/config/sys.config b/config/sys.config
index 905b8a1..d5b99f2 100755
--- a/config/sys.config
+++ b/config/sys.config
@@ -38,6 +38,33 @@
{gtpc_remote_port, 2123}
]},
%% ===========================================
+ %% gtp_u_kmod config
+ %% ===========================================
+ {gtp_u_kmod, [
+ %% grx: Name used to log by the module.
+ {sockets, [{grx, [%% ip: IP Address assigned at the tunnel. TODO: not currently applied?
+ {ip, {192,0,2,16}},
+ %% Create the tun socket on a given netns:
+ %%{netns, "mynetns"},
+ %% Bind tun socket to a particular interface (SO_BINDTODEVICE):
+ %%{netdev, "grx"},
+ %% Allow binding to an IP address that is nonlocal or does not (yet) exist (IP_FREEBIND):
+ freebind,
+ {vrf, [{routes, [{{10, 180, 0, 0}, 16}]}%%,
+ %%{netdev, "upstream"}
+ ]
+ }
+ ]
+ }]
+ }
+ ]},
+ %% ===========================================
+ %% gen_socket config
+ %% ===========================================
+ {gen_socket, [
+ {libdir, "_build/default/lib/gen_socket/priv/lib"}
+]},
+ %% ===========================================
%% Lager logging config
%% ===========================================
{lager, [
diff --git a/debian/osmo-epdg.install b/debian/osmo-epdg.install
index 0840d06..62aec37 100644
--- a/debian/osmo-epdg.install
+++ b/debian/osmo-epdg.install
@@ -1,2 +1,3 @@
/contrib/systemd/osmo-epdg.service /lib/systemd/system/
/_build/default/bin/osmo-epdg /usr/bin/
+/_build/default/lib/gen_socket/priv/lib/gen_socket*.so /usr/lib/${DEB_HOST_MULTIARCH}/
diff --git a/rebar.config b/rebar.config
index 19688f5..8541410 100644
--- a/rebar.config
+++ b/rebar.config
@@ -5,6 +5,7 @@
{deps, [
{lager, {git, "https://github.com/erlang-lager/lager", {tag, "3.9.2"}}},
{gtplib, "3.2.0"},
+ {gtp_u_kmod, {git, "https://github.com/osmocom/gtp_u_kmod", {branch, "osmocom/master"}}},
{osmo_ss7, {git, "https://gitea.osmocom.org/erlang/osmo_ss7", {ref, "9f294d3612f998860004820d1d85b4264721577b"}}},
{osmo_gsup, {git, "https://gerrit.osmocom.org/erlang/osmo_gsup", {branch, "osmocom/epdg"}}}
]}.
diff --git a/rebar.lock b/rebar.lock
index a542cbc..fb3a190 100644
--- a/rebar.lock
+++ b/rebar.lock
@@ -4,7 +4,23 @@
{git,"https://github.com/msantos/epcap",
{ref,"b98edbfbb0392101cd874b098caa5180f2f44b2e"}},
1},
+ {<<"erlando">>,
+ {git,"https://github.com/travelping/erlando.git",
+ {ref,"2cb56e06308beb4d65ae2217a02dc60bafc99b9d"}},
+ 1},
+ {<<"gen_netlink">>,
+ {git,"https://github.com/osmocom/gen_netlink",
+ {ref,"82c31b9d36ca8c524db0670b01a3e4ee69058930"}},
+ 1},
+ {<<"gen_socket">>,
+ {git,"https://github.com/osmocom/gen_socket",
+ {ref,"35e11d6e2f6d87b02dcfc7507a9500bf7ca7329e"}},
+ 2},
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1},
+ {<<"gtp_u_kmod">>,
+ {git,"https://github.com/osmocom/gtp_u_kmod",
+ {ref,"80b935629202af1bcc909367df5ce4b89f584dea"}},
+ 0},
{<<"gtplib">>,{pkg,<<"gtplib">>,<<"3.2.0">>},0},
{<<"lager">>,
{git,"https://github.com/erlang-lager/lager",
diff --git a/src/osmo_epdg.app.src b/src/osmo_epdg.app.src
index ec60bd2..4481df5 100644
--- a/src/osmo_epdg.app.src
+++ b/src/osmo_epdg.app.src
@@ -11,7 +11,8 @@
gtplib,
diameter,
osmo_gsup,
- osmo_ss7
+ osmo_ss7,
+ gtp_u_kmod
]},
{mod, {osmo_epdg_app, []}},
{env, []}
To view, visit change 35943. To unsubscribe, or for help writing mail filters, visit settings.