Move static global pdp storage arrays to be per GSN. This way now
several GSN per process are supported without collisions.
* pdp_init() is defined in public API but it's actually only intended
for use (and currently only used) internally in gtp_new(). So let's
document that and re-use it for backward compatibility with now
deprecated API, where only one GSN per process is supported.
* Back pointer to gsn_t (pdp->gsn) moved from gtp.c:gtp_new() to
gtp_pdp_newpdp(), since it makes more sense to have it there. This way
backpointer is always set, even in case were app calls pdp_newpdp() API
directly instead of creating them through gtp.c, like osmo-sgsn does.
* Create new versions of required APIs with a pointer to gsn_t where the
pdp ctx is to be created/found. Some APIs receiving a pointer to a pdp
ctx can be left intact because we have a backpointer to its gsn_t.
* pdp_getpdp() is nowhere used, and makes little sense now that we have
pdpa reachable in gsn->pdpa, so let's deprecate it without adding a
replacement.
* Deprecate gtp.h gtp_newpdp(), since it's nowhere used and useless
(does same as new gtp_pdp_newpdp() and doesn't allow for old_pdp to be
passed as parameter).
Fixes: OS#2873
Change-Id: I653cbdc185165592d985e3efab6e3f1add97877b
Fixes following ASan complaint during VTY "show running-config":
osmo-ggsn/ggsn/ggsn_vty.c:657:37: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Change-Id: I2b8d163dbc108b0fb5a1e820dc23181835d12869
Nowadays we have one tun device per APN, so we don't need this hash
table because we use the ippool of the APN to find the related PDP ctx
pointer.
Change-Id: Ife3f222daa87f0630ff34ffc3e63f4dad2ad914b
Code modified actually behaves the same, since gtp_freepdp() also calls
delete cb, and this way it's more consistent with rest of the code base.
Change-Id: I299765816e9d885497110d2e834f7ccdc943052c
* API gtp_freepdp was already there but was not really being used by
anyone currently, so we can change its behaviour to call cb_delete_ctx.
It makes sense to call the cb in there too to be consistent with rest of
APIs.
* Add API gtp_freepdp_teardown, which calls gtp_freepdp on pdp and its
secondary contexts. It will also be used later on by osmo-ggsn.
* Use new APIs in internal code to simplify it.
Change-Id: I9f0b774e9385a7a8d81ec9702f158e2f9a50d571
Move all parsing with same conditions under same blocks to make code
easier to follow and make it more compact.
Change-Id: I52d5a3543ce6cf764bd84303b5a0d8b0643d998d
Before this patch they were not taken into account, which means some
resp messages could stay more time than required enqueued.
Change-Id: Iebf405b2310a34785f3b363cc2a9f415281f6030
This timer was added in osmo-ggsn.git
dda21ed7d4,
but it was never initially started since it was introducing, and as a
result retransmissions never being triggered.
Also as a consequence, gtp_retrans is never called. That function is
responsible from triggering retransmissions and to free old responses
waiting in the resp queue (to check for duplicates). Since it's never
called, the retransmit resp queue will grow over time.
Fixes: dda21ed7d4
Fixes: OS#3997
Change-Id: Ie4adc52829446539fbbb5e9e0cf75a04f91c7eea
Instead of printing subscriber's MSISDN as a hex-string, let's
attempt to decode it using gsm48_decode_bcd_number2().
Change-Id: I3f3a105dc8d0d582f2b9d8e1ff6c5785369e569b
An actual APN can be different from the one that was requested by
user, e.g. when 'default-apn' VTY parameter is used. The one that
was requested is already being stored in the PDP context state.
Let's also store a chosen APN in create_context_ind().
Change-Id: I9cbe195f64e5b83d5158c175aad2e81ba2487850
The existing PCO processing is implemented in a rather convoluted
way. We scan the list of PCO elements several times for different
PCO protocols. Let's change to a straight-forward model where we
simply do one iteration over the list of PCO elements and generate
responses step by step.
Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c
When build_ipcp_pco() iterated over the PCO list, it didn't use
the "outer" pco length as an increment, but used the "inner" IPCP
length.
If an IPCP message with an invalid "inner" length was being processed
(see pcap file attached to OS#3914), the PCO iteration beyond that
broken IPCP would fail, possibly rendering false hits.
Let's make pco_contains_proto() return a pointer to the the pco_element,
so that the caller can use the outer length as an increment.
Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c
Related: OS#3914
Previously we've always returned error code from main() even in case of
regular expected shutdown. Let's not confuse it with actual error
shutdown and return 0 by default.
Change-Id: I7fe0d3e052953d5b87ce65649d88d83476fee3c0
Add new environment variables WITH_MANUALS and PUBLISH to control if
the manuals should be built and uploaded. Describe all environment vars
on top of the file.
When WITH_MANUALS is set, install osmo-gsm-manuals like any other
dependency and add --enable-manuals to the configure flags (for "make"
and "make distcheck"). Add the bin subdir of the installed files to
PATH, so osmo-gsm-manuals-check-depends can be used by ./configure.
Related: OS#3385
Change-Id: I43e3b592c593237eb4df2d70c926c031ddb7b20b
Set AM_DISTCHECK_CONFIGURE_FLAGS in Makefile.am instead of
DISTCHECK_CONFIGURE_FLAGS. This is the recommended way from the
automake manual, as otherwise the flag can't be changed by the user
anymore.
Related: OS#3718
Change-Id: I810b2b96ea077e8bd5ab01df5137e214a4349628
Moved to doc/manuals/, with full commit history, in preceding merge commit.
Now incorporate in the build system.
Build with:
$ autoreconf -fi
$ ./configure --enable-manuals
$ make
Shared files from osmo-gsm-manuals.git are found automatically if
- the repository is checked out in ../osmo-gsm-manuals; or
- if it osmo-gsm-manuals was installed with "make install"; or
- OSMO_GSM_MANUALS_DIR is set.
Related: OS#3385
Change-Id: I14533676d5774ee0d0ee5054ba77d7dac32cff43
Apply VTY reference changes from libosmocore: change node IDs from index
numbers to meaningful names from VTY node prompts.
Introduce section with common commands, do not repeat the common commands on
each child node.
Populate section names (so far empty).
Add apn / gpdu VTY reference.
This is generated using the recent libosmocore vty doc patches that conclude in
libosmocore change-id Iedd67750539b676271de0e0e9316d4e6f794406a.
Change-Id: Ia269c4bda0aa0b905abcccc75338f5f808e01727
To omit whitespace changes in an upcoming patch that updates the VTY reference
and will use '\n' line breaks, convert line breaks from '\r\n' to '\n' without
any other changes.
Change-Id: Id0d1a3a82c3d670cbb041884554b5d79fdfb0f28
Add examples for 'ip addr add' and mention correspondence to config file,
add examples for enabling masquerading and IP forwarding,
place the non-root config in its own section and highlight the diffs.
Add tiny hint at systemd-networkd.
Change-Id: I02bd9cfa35c7f2fb338d5d92c2e968fe80574a78
The initial goal was to make sure we don't have overall FORCE rules causing
unnecessary rebuilds -- annoying while writing documentation. As I looked
through possible dependencies, I finally understood what's going on here.
Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In
each, describe in a top comment how to use it, and also unify how they are
used:
- Rename Makefile.inc to Makefile.docbook.inc and refactor
- Add Makefile.vty-reference.inc
- Add Makefile.common.inc
Make sure that we accurately pick up all dependencies.
Drop use of the macro called 'command', that silenced the actual command lines
invoked and replaced them with short strings: it obscures what is actually
going on and makes the Makefiles hard to read and understand.
Each manual's makefile is greatly reduced to few definitions and a Makefile
include, e.g. one for asciidoc, one for VTY reference.
Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link
from OsmoNITB. It applies only to OsmoBSC and OsmoNITB.
Add a script that combines a VTY reference file with *all* additions files
found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc.
Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0
* Some people want to manually create/configure their tun devices,
show them how to do this using ip with the correct parameters
* Let's not call the network device 'ggsn' but rather 'apn0', as
the device has a 1:1 correspondence to the APN, not to the GGSN.
Change-Id: I2fef818bfcb8cb521397136539f492922d5f6def