aboutsummaryrefslogtreecommitdiffstats
path: root/ggsn
AgeCommit message (Collapse)AuthorFilesLines
2017-08-12lib/ippool: Move ippool_aton() out of ippool_new()Harald Welte1-10/+11
we rather pass the in46_prefix directly into ippool_new() Change-Id: Iadf6274e881a9bfc75eb41f9380f5ae2d8c92a0f
2017-08-12gtp-kernel: Remove dependency to cmdline.[ch]Harald Welte3-21/+14
Change-Id: I760f25df609c309eba4d5716f3e23b49320449bf
2017-08-11Support setting TUN device IPv6 address + prefixHarald Welte1-8/+8
As we can now have PDP contexts with IPv6 user IP payload, it is useful to extend the TUN related code to be able to configure the tun device IPv6 address + prefix length Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6
2017-08-11IPv6: Support PCO for IPv6 DNS addressesHarald Welte1-41/+136
In IPv6, DNS server information is not passed along as IPCP6 like in IPv5 with IPCP. The reason is that IPCP6 (for PPP) doesn't support passing DNS server information. Rather, the relevant RFCs indicate DHCPv6 should be used even over point-to-point links. 3GPP decided to avoid DHCPv6 dependency for stateless autoconfiguration (the only mandatory IPv6 configuration mechanism) and added some new non-PPP-style PCO information elements ("containers") which can among other things inform a MS about IPV6 DNS servers. That same mechanism can also be used to inform the MS about IPv4 DNS servers, so for IPv4 there are now two competing mechanisms: IPCP and the new "native" PCO container. With this patch, we support both for IPv4. Change-Id: I21499afd61def8c925f7838bde76f34d28214b56
2017-08-11IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisementHarald Welte6-2/+504
The 3GPP specs are quite strange when it comes to how an IPv6 address or rather prefix is assigned to an IPv6 PDP context. The designated method for allocating the IPv6 address via the PDP EUA (End User Address) Information Element in the GTP signalling plane is *not* used to allocate the address/prefix. Instead, the EUA is used to allocate an "interface identifier" to the MS, which it the uses to derive its link-local source address to send a router solicitation. The GGSN subsequently answers witha router advertisement, advertising a single/64 prefix, whihcthe MS then uses to generate it's real IPv6 source address for subsequent communication. Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f
2017-08-09ippool: Extend pool to work with /64 prefixesHarald Welte1-1/+5
In IPv6 GPRS, we actually don't want to allocate an individual v6 address (like in IPv4), but we want to allocate a prefix. The standard prefix lengh is 8 bytes, i.e. a /64 prefix. This patch extends the pool to be able to work with such v6 prefixes. Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443
2017-08-09ggsn: Send proper errors in create_context_ind()Harald Welte1-3/+11
When we receive PDP context requests for unknown PDP types or if we run out of dynamic addresses, we need to inform the SGSN that PDP context creation failed. Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06
2017-08-09IPv6 support for user IPHarald Welte1-3/+8
This patch enables the use of IPv6 PDP contexts. The phone will have to request an IPv6 End-user-Address, and the GGSN will have to be configured for an IPv6 pool. The outer transport-layer IP between SGSN and GGSN must still be IPv4, it is not modified by this patch Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774
2017-08-09lib/tun.h: Remove non-endian-safe redefinition of IP headerHarald Welte1-3/+5
We can simply use 'struct iphdr' from netinet/ip.h to achieve the same goal (and be portable). Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32
2017-08-09ippool: Add IPv6 support to IP pool implementationHarald Welte3-26/+30
Extend the IP pool implementation to be able to manage both pools of 32bit addresses (IPv4) as well as pools of 128bit addresses (IPv6) Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8
2017-08-04Proper fix for "Force Dynamic IP" in Create PDP CTXHarald Welte1-1/+3
An EUA length of *2* octets indicates dynamic IP address, while an EUA length of 0 is invalid. Let's fix this hack (which needs to finally be removed anyway). Change-Id: Ib1b57eb0654327882044d6862d955f4b32aa6bcd
2017-05-16ctrl: cleanup trap creationMax1-11/+16
Move common trap create/send code into separate function. Change-Id: Iaadc921b951aeb9b3ad5ab796e13d52017139468
2017-02-23gtp-kernel: Fix tunnel creation/removal for GTP Version 1Harald Welte1-2/+5
When Linux Kernel GTP-U support is enabled, OpenGGSN so far only worked with GTPv0,but not with GTPv1, as the TEI values were not correctly configured. This patch fixes the initialzation of the local and remote TEI before using libgtpnl to create a tunnel context in the kernel. Change-Id: I3e953ff5b4ab44c26dbbe20d18b61038fa57ff32
2016-11-02Only send TRAP for defined PDP peerMax1-6/+8
Do not attempt to send TRAP message on PDP context deletion if peer is unknown. Change-Id: I5e02c1d42bb7aaf1ef81a9824aab7b12047cdd3e Fixes: Coverity CID 150135
2016-10-12Add control interfaceMax2-4/+30
Only generation of TRAP messages over Control Interface is supported so far. Note: requires corresponding version of libosmoctrl. Change-Id: Ia76f841d2c9cd14394e9316fcd39f4060e23c898 Related: OS#1646
2016-10-11Remove unused functionMax1-1/+0
Change-Id: Iff0f1499660b12a47277b16a435efecb42fab038
2016-05-12ggsn: fix compilation error with --disable-gtp-kernelPablo Neira Ayuso1-1/+1
gtp-kernel.h: In function ‘gtp_kernel_init’: gtp-kernel.h:25:15: error: ‘struct gengetopt_args_info’ has no member named ‘gtpnl_given’ if (args_info->gtpnl_given) { ^ Makefile:422: recipe for target 'ggsn Reported-by: Holger Freyther <holger@freyther.de>
2016-05-10ggsn: cmdline: no need to specify interface anymorePablo Neira Ayuso5-34/+35
--gtpnl is now gone, instead you have --gtpkernel that behaves as an on/off toggle. We full rely on the kernel routing base to select the real device to transmit. I have updated ggsn/cmdline.ggo and then run 'gengetopt' to refresh the automatic code generation for command line options that openggsn uses.
2016-05-10ggsn: gtp-kernel: adapt gtp_dev_create() to its new interfacePablo Neira Ayuso1-2/+1
Andreas modified this interface, so update so this compiles again.
2015-12-21ggsn: update gpt-kernel logging to libosmocoreAndreas Schultz3-14/+11
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
2015-12-21ggsn: add support for GTP kernel data encapsulationPablo Neira Ayuso7-18/+369
This patch adds the -g, --gtpnl=device option that allows you to enable the GTP kernel tunneling mode in openggsn. You have to specify the real downlink device that will be used to tunnel traffic, eg. -g=eth0 This means that the gtp0 device will be created and it will use eth0 as the real device to encapsulate packet coming from the Internet that are addressed to the MS (so the tunnel devuce encapsulates these IP packets in GTP packets when traveling to the SGSN). Alternatively, you can also add this to the ggsn.conf configuration file: gtpnl eth0 The device has to be the real device that can route packets to the SGSN, if you select the wrong device, the kernel routing code may not find a way to reach the SSGN, you've been warned. Therefore, if this option is set, the operational becomes the following: 1) A gtp0 device is created via rtnetlink and configure the socket encapsulation infrastructure in the kernel. 2) Whenever a PDP context is created, this adds the necessary tunnel configuration via genetlink GTP interface. 3) Whenever a PDP context is destroyed, this deletes the tunnel via genetlink GTP interface. 4) Destroy the gtp0 device if ggsn is stopped, including all of the existing tunnels. You require the osmo-ggsn.git tree, which contains the kernel module gtp.ko and the libgtpnl library that you have to compile and install. Make sure you have loaded the gtp.ko kernel module before launching the ggsn daemon using the kernel driver mode, otherwise you will get a nice "operation not supported" error message ;-). This patch also adds supports for "ipup" configuration option to invoke an external script after the gtp0 device has been brought up. Typical command to add the route to reach the MS behind the GGSN is required, eg. ip route add 10.0.0.0/8 dev gtp0. The (horrible) ggsn parser has been manually extended to support the new configuration option. That code doesn't look nice, but it just mimics what we already have there for consistency, please don't blame me for that. If you want to run in debugging mode, I suggest you to use: sudo ggsn -c ggsn.conf -f -d Note that you do have to run openggsn as root to bring up the gtp0 device. You have to see this message that announce that the GTP kernel mode is enabled. openggsn[1106]: ggsn.c: 656: Using the GTP kernel mode (genl ID is 25) This patch also automagically sets up route to reach MS from Internet just like tun mode does. This is fundamental to get this working, better don't leave to the admin, he may forget to add this route. In this patch, I tried to encapsulate this new feature as much as possible as Harald initially suggested. To compile this feature, you have to pass --enable-gtp-kernel, ie. ./configire --enable-gtp-kernel Otherwise, the code to interact with the gtp kernel part is not compiled. Signed-off-by: Andreas Schultz <aschultz@tpip.net>
2014-12-04ggsn: Move printf to DEBUGP statements in the ggsn as wellsysmocom/libosmocoreHolger Hans Peter Freyther1-25/+11
The specific log statements are not great yet but at least they will end up in the log file. In the future everything should be related to the IMSI or at least the tunnel id.
2014-12-04ggsn: Remove unused dump/logging methodHolger Hans Peter Freyther1-15/+0
2014-12-04ggsn: Be able to set the log level for the text fileHolger Hans Peter Freyther4-1/+43
Fixes: SYS#599
2014-12-04logging: Switch to using libosmocore logging for all the codeHolger Hans Peter Freyther2-42/+37
2014-03-23cli: Introduce a logfile command to log errors to a fileHolger Hans Peter Freyther4-1/+41
The evolution would be to introduce libosmocore and start using the logging framework. But even then we can map this option to the file target. Fixes: SYS#263
2014-03-23cli: Manually patch the generated code to fix compiler warningHolger Hans Peter Freyther1-2/+0
cmdline.c: In function ‘cmdline_parser_internal’: cmdline.c:588:7: warning: variable ‘check_required’ set but not used [-Wunused-but-set-variable] int check_required; ^
2014-03-23cli: Re-generate the cmdline.c/cmdline.h with newer gengetoptHolger Hans Peter Freyther2-1124/+1228
2012-11-06build: Remove subdir-objects as it breaks make distcleanHolger Hans Peter Freyther1-3/+1
We are not using this option in any of our projects and it is breaking make distclean. Remove the option for now. make[2]: Entering directory `/openggsn-0.91/_build/ggsn' Makefile:307: ../lib/.deps/getopt.Po: No such file or directory Makefile:308: ../lib/.deps/getopt1.Po: No such file or directory make[2]: *** No rule to make target `../lib/.deps/getopt1.Po'. Stop.
2011-11-02Convert all code to Linux coding styleHarald Welte3-1503/+1594
After so many years of silence, we don't expect the original author to return to the project. To make things a bit simpler for us, we convert the coding style to what we are used to (Linux style). The conversion was made using the 'Lindent' script which is part of the Linux kernel.
2011-05-10properly build a library for the content of the lib directoryHarald Welte1-6/+3
2010-10-20Do not exceed 80 characters per lineEmmanuel Bretelle1-3/+6
Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20Move common sgsnemu/ggsn files to directory "lib"Emmanuel Bretelle13-3226/+7
Some files like in sgsnemu and ggsn directory where exactly the same. They are now moved to the same directory for easier maintenance Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-10-20Fixed compile warning,exit if cant daemonizeEmmanuel Bretelle1-4/+19
Relevant output of make: ggsn.c: In function ‘main’: ggsn.c:436: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result ggsn.c:437: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result ggsn.c:438: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result ggsn.c:439: warning: ignoring return value of ‘daemon’, declared with attribute warn_unused_result Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
2010-05-24fix 'make distcheck': add lookup.h to Makefile.amHarald Welte1-1/+1
2010-05-04Use newer gengetopt which also frees memoryHarald Welte3-467/+901
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811521&group_id=68956&atid=522957
2010-05-04GGSN: free the ippool memory before exitHarald Welte1-0/+1
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811518&group_id=68956&atid=522957
2010-05-04Fix various compiler warnings throughout the codeHarald Welte5-10/+10
Mostly signed/unsigned and typecasting issues Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811517&group_id=68956&atid=522957
2010-05-04GGSN: Fix select() error case, we need to FD_ZERO() againHarald Welte1-0/+2
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811515&group_id=68956&atid=522957
2010-05-04Fix GGSN signal handlingHarald Welte1-3/+16
In order te exit gracefully (closing the tun devices), we install a SIGINT handler and note its occurrence in a global variable. This fix is from http://sourceforge.net/tracker/index.php?func=detail&aid=1811513&group_id=68956&atid=522957
2010-05-04remove autotools-generated filesHarald Welte1-466/+0
All those will be re-generated by "autoreconf -i" anyway, so there's no point in keeping them in the repository. Also, the 'bootstrap' script is no longer working with recent autotools versions anyway.
2005-03-14Added new version of autotoolsjjako2-141/+235
2004-12-300.84 releasejjako2-4/+6
2004-12-300.84jjako2-5/+8
2004-12-30Added lookup.cjjako2-0/+105
2004-12-30QA on ippooljjako5-108/+42
2004-12-30Minor fixjjako3-3/+2
2004-12-30Fixed delete route on freebsd et. al.jjako2-16/+57
2004-09-17qos length bugfix and apple support plus header cleanupjjako7-46/+30
2004-09-17QoS length bugfizjjako1-1/+1