[PATCH] initial commit for libosmo-gtp

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Neels Hofmeyr nhofmeyr at sysmocom.de
Sat Oct 17 20:52:07 UTC 2015


On Sat, Oct 17, 2015 at 10:53:53AM +0200, Harald Welte wrote:
> Hi Neels and Pablo,
> 
> first of all, it is great to see this code appear, I never liked libgtp
> much either...
> 
> On Thu, Oct 15, 2015 at 03:32:02PM +0200, Neels Hofmeyr wrote:
> > > +struct gtp0_header {
> > > +#if BYTE_ORDER == BIG_ENDIAN
> > > +	uint8_t version:3,
> > > +		pt:1,
> > > +		spare:3,
> > > +		snn:1;
> > > +#elif BYTE_ORDER == LITTLE_ENDIAN
> > > +	uint8_t snn:1,
> > > +		spare:3,
> > > +		pt:1,
> > > +		version:3;
>
> /usr/include/netinet/ip.h or /usr/include/netinet/tcp.h

Learning never ends indeed. Thanks!

And then, I take it, the bits within each bitfield element are also
reversed, but since it matches the host, they are correct and ready...

I'm confused by the fact that the bitfields' order is "reversed" on BE.
Is that consistent with shift left and right operators?? Don't tell me
that you have to reverse those as well on a BE system.

Either way, would be great if C had a way that doesn't need everything
written twice...


[... TLVs]
> Well, that's how we generaly deal with TLVs in libosmocore based
> programs :)

About that: I see that values are referenced from the struct tlv_parsed.
That's mighty fast. But GTP does have duplicate IEs: more than one LV
with the same T. I need to loop tlv_parse_one() myself then, right? :/

I noticed because I found code in libgtp that targets the second occurence
of an IE type. The one instance I know of so far is in

 etsi/GSM/by_chapter/29.060.pdf  7.3.2 Create PDP Context Request

which has NSAPI and Linked NSAPI both referencing 7.7.17, as well as two
SGSN addresses both referencing 7.7.32 as IE description.

> Beware, Pablo is a CS Professor at Sevilla University ;)

/me bows

I actually picked some oranges in the Sevilla Monasteria once - delicious!
It was free, too. And I had una thervesa on the Alameda :)

~Neels

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20151017/fd72ff75/attachment.bin>


More information about the OpenBSC mailing list