aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-11-14contrib/jenkins.sh: Allow jenkins job to specify if kernel GTP is usedHEADmasterHarald Welte1-1/+1
Change-Id: Id9869d0f3d516b5380430675f879887468b5803d
2017-09-24sgsnemu: Fix gengetopt package nameHarald Welte3-8/+5
gengetopt by default picks the program name from PACKAGE (autotools), which is openggsn and is obviously wrong in case of sgsnemu. After this patch, "sgsnemu --help" no longer shows "openggsn" but "sgsnemu" at the top of the help text. Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37
2017-09-24sgsnemu: Re-generate cmdline.[ch] using gengetoptHarald Welte4-1400/+1419
This will replace the manual additions to cmdline.[ch] with auto-generated code from gengetopt. We need to fix-up the RAT Type in sgsnemu.c as the manually-added code diverged from what gengetopt generates. Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c
2017-09-24sgsnemu: Fix up gengetopt file for --norecoveryHarald Welte1-0/+1
In commit 3a4c67b4bf0067c4949a60bc750d01e0576c5e08 we introduced the --norecovery command line option, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I1698280a699b17cea65651c3736ef149aba7e432
2017-09-24sgsnemu: Fix up gengetopt file for RAIHarald Welte1-0/+1
In commit 41af5691ef08fb70e2c65aba03c8b9e6c20983a6 we introduced the --rai command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644
2017-09-24sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisvHarald Welte1-0/+4
In commit 944dce3e66f3bc5b74f24dfbbee2370a231a39a9 we introduced various command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a
2017-09-24sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008Harald Welte1-1/+5
In commit 11a398fbc3ad9b655d8ba947bea7012f7ce81604 we introduced the --qose{1,2,3,4} command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20
2017-09-24sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supportedHarald Welte1-3/+3
It seems like modern gengetopt no longer supports 'unsigned int' argument types, and we need to use 'int' instead. tested with 2.22.6 Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e
2017-09-06note OpenGGSN is obsoleted by OsmoGGSNHarald Welte1-0/+7
Change-Id: I477382cf3e015976401218b628b911580d935d53
2017-09-05lib/tun: Mark internal helper functions 'static'Harald Welte1-3/+3
Change-Id: I53a8a89abb0080a39a153e9d3864c17b29aa193c
2017-09-05Remove __sun__ code that is unmaintainedHarald Welte2-264/+0
We haven nobody maintaining this platform, let's remove it. In fact, only Linux and FreeBSD are part of the jenkins build tests, so even Apple/MacOS is up for disposal. However, as it's more popular, let's keep the code. Change-Id: Id6b8179259bacade52c39f96e688f828eff164ac
2017-09-05libgtp: Add back-reference to gsn from pdp contextHarald Welte2-1/+11
This is required once one wants to support multiple GSNs in a single application. WARNING: This breaks ABI compatibility, LIBVERSION must be adjusted Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2
2017-09-05libgtp: Remove ctrl_handle from gsn_t, replace with private contextHarald Welte2-6/+4
The control interface handle never belonged into libgtp in the first place. Commit 727417dd28813c697b4820aef9f54f249e30c4b8 should not have added this to the shared library (used by sgsnemu, osmo-sgsn, ...), but to some private state of the GGSN. Introducing a private context pointer at the same location will keep ABI compatibilty. Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5
2017-09-05lib/tun.c: Proper cleanup during tun_new() error pathsHarald Welte1-13/+32
Change-Id: I285be20df76774ac7258b6edb3d4f2d28703757d
2017-09-05lib/ippool: Move ippool_aton() out of ippool_new()Harald Welte3-29/+24
we rather pass the in46_prefix directly into ippool_new() Change-Id: Iadf6274e881a9bfc75eb41f9380f5ae2d8c92a0f
2017-09-05lib/ippool: Add back-pointer from pool member to poolHarald Welte2-0/+3
This allows us to remove pool members without having to keep a pointer to the pool around. Change-Id: I9042eb85989c5451d7894678eca110dd19e78002
2017-09-05lib/in46_addr: Avoid ASSERT() when in46a_ntop() is called on uninitialized ↵Harald Welte1-1/+8
address Change-Id: I42d41ec1370b9cc15d372b649d8e1bc78e76af9b
2017-09-05lib/in46_addr: Add 'struct in46_prefix' to represent addr + prefixHarald Welte2-0/+13
Change-Id: I797d105117e81951732bcfc2cc26a8d00fd69443
2017-09-05lib/in46_addr: Add in46a_ntoa() function, similar to inet_ntoa()Harald Welte2-0/+11
Change-Id: I752b7033a106a74dc219047da5c3a7ad3cd3602e
2017-09-05lib/tun: Add 'void *priv' pointer to tun_tHarald Welte1-0/+2
This allows the application to attach some private state to the tun device, such as the context from which it was created/allocated Change-Id: Ief43b9b5fab5830fa8e28362c795f88f0b4d353b
2017-09-05lib/tun: Add missing #include to net/if.h for IFNAMSIZHarald Welte1-0/+2
Change-Id: I979867d643c9fa912884fe55105333dbad39ab97
2017-09-05gtp-kernel: Remove dependency to cmdline.[ch]Harald Welte3-21/+14
Change-Id: I760f25df609c309eba4d5716f3e23b49320449bf
2017-09-05update jenkins.sh to conform with current build environmentHarald Welte1-13/+31
Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c
2017-08-30ggsn: Fix DNS not sent in PDP context responsePau Espin Pedrol1-2/+2
During IPv6 support implementation, helper function pco_contains_proto was added which contains an error: It is only capable of finding first protocol correctly, and as a consequence, in my setup DNS servers where not sent back to the SGSN/MS, resulting in phone being able to connect to IPs but not to domain names which required DNS resolution. The condition in the while loop is also changed to match the increment of the variable inside the loop to make it easier to understand at first glance. Fixes: 1ae98777d9b1ee62e6900caf4bb580d1a42bb416 Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e
2017-08-28Use release helper from libosmocoreMax4-1/+16
See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Related: OS#1861
2017-08-26Use value string check from osmo-ciMax1-3/+3
Change-Id: I036ed452826b9a6848d22d45bdcc95e20a110b8b
2017-08-22libgtp: expand loggingMax1-10/+7
* print destination address on sendto error * print address length on conversion error * log listening address * log GTP version on PDP context errors * fix incorrect logging message for unknown GSN peer Related: SYS#3610 Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27
2017-08-14update debian/changelog to 0.94 + fix pkg-config versionHarald Welte2-2/+13
This updates the debian changelog to 0.94 and adds some logic to debian/rulres which fixes the version of the libgtp.pc file built as part of our OBS builds (used to be UNKNOWN since commit 23eea1d132120198745dcca32728906d5f05dc5f) Change-Id: I883feaef35ff5ffd1b22fb255b7c36112b4a8f3b
2017-08-13libgtp: Delete PDP context on receiving GTPv1 Error IndicationHarald Welte3-6/+53
When a peer GSN receives a GPDU for an unknown PDP context, it sends a GTP Error Indication. This Error Indication should be used to delete the offending PDP context locally. In GTPv1, the Error Indication contains some mandatory IEs using which we can look up the PDP context and delete it. The existing code only dealt with GTPv0 Error Indications which lack those IEs and use the TEI in the header instead. Change-Id: I3e843f9ef1d6fd7868cc992e083c0891d16b6da9 Closes: OS#2426
2017-08-12libgtp: Add missing mandatory IEs in GTP Error IndicationHarald Welte1-1/+11
Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e
2017-08-12Properly format IMSI before using it in trapHarald Welte3-1/+30
For some reason Max' commits introducing the CTRL/trap interface about one year ago didn't convert the IMSI to its actual textual representation before usign it in the CTRL interface. Let's clean that up by properly interpreting the IMSI. Change-Id: I8b20d2e47a29de266d93a7ddd5e6877f7e346a63
2017-08-11Use osmocom-style git-version-gen / .version magic0.94Harald Welte4-2/+163
This generates the version number from the latest tag + git history Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12
2017-08-11tun_new(): Fix array overflow in FreeBSD related codeHarald Welte1-1/+1
Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
2017-08-11replace hand-coded tun_gifindex() with standard POSIX if_nametoindex()Harald Welte1-25/+3
Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5
2017-08-11Support setting TUN device IPv6 address + prefixHarald Welte3-19/+127
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: in46_addr: OSMO_ASSERT() in case of unsupported callsHarald Welte1-0/+6
There's a bit of trickery with the ip_pool and it's "lengty=8" IPv6 prefix handling, let's make sure we don't accidentially call any support functions with addresses of wrong length. Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5
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 Welte8-2/+510
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 Welte3-8/+17
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-09in46_addr: Add new function in46a_prefix_equal()Harald Welte2-0/+18
This function is used to compare an IPv6 address against another, using the smaller of the two prefix lengths. Change-Id: Ic993d8abdc90897cb55276f01ae3b8a5eadf5a0d
2017-08-09ggsn: Send proper errors in create_context_ind()Harald Welte3-11/+20
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 Welte4-4/+74
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-09ippool_new(): const-ify input argumentsHarald Welte2-2/+2
Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904
2017-08-09lib/tun.h: Remove non-endian-safe redefinition of IP headerHarald Welte4-20/+39
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 Welte9-172/+374
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-06-09libgtp: improve error logging and propagationMax1-13/+13
* propagate error code from gtp_new() to caller instead of always returning -1 * on socket-related failures log explicitly which kind of socket caused error * log expected GTP version for unexpected packets Change-Id: Ie07f1e4246eb178838b7df21946a08a1f60f2084 related: SYS#3610
2017-05-16ctrl: cleanup trap creationMax1-11/+16
Move common trap create/send code into separate function. Change-Id: Iaadc921b951aeb9b3ad5ab796e13d52017139468
2017-05-09contrib: Start openggsn after networkingDaniel Willmann1-0/+1
Change-Id: Ic617c618db17e7109ee864c4e6c86f3bee081d02
2017-03-18track README.md rename in spec file and debian/docsHarald Welte2-2/+2
When README was renamed to README.md, the debian and rpm packaging information was not updated. Change-Id: I3fb3016defb74cf4e9c0a363f70eff9d6f71a5f5