libosmogb 1.9.0.196-9975
Osmocom Gb library
gprs_ns_frgre.c File Reference

NS-over-FR-over-GRE implementation. More...

#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <osmocom/core/select.h>
#include <osmocom/core/byteswap.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/socket.h>
#include <osmocom/gprs/gprs_ns.h>
#include "common_vty.h"

Data Structures

struct  gre_hdr
 

Macros

#define GRE_PTYPE_FR   0x6559
 
#define GRE_PTYPE_IPv4   0x0800
 
#define GRE_PTYPE_KAR   0x0000 /* keepalive response */
 
#define IPPROTO_GRE   47
 

Functions

struct gre_hdr __attribute__ ((packed))
 
static int handle_rx_gre_ipv4 (struct osmo_fd *bfd, struct msgb *msg, struct iphdr *iph, struct gre_hdr *greh)
 
static struct msgbread_nsfrgre_msg (struct osmo_fd *bfd, int *error, struct sockaddr_in *saddr)
 
int gprs_ns_rcvmsg (struct gprs_ns_inst *nsi, struct msgb *msg, struct sockaddr_in *saddr, enum gprs_ns_ll ll)
 Receive incoming NS message from underlying transport layer. More...
 
static int handle_nsfrgre_read (struct osmo_fd *bfd)
 
static int handle_nsfrgre_write (struct osmo_fd *bfd)
 
int gprs_ns_frgre_sendmsg (struct gprs_nsvc *nsvc, struct msgb *msg)
 
static int nsfrgre_fd_cb (struct osmo_fd *bfd, unsigned int what)
 
int gprs_ns_frgre_listen (struct gprs_ns_inst *nsi)
 

Variables

uint16_t flags
 
uint16_t ptype
 

Detailed Description

NS-over-FR-over-GRE implementation.

GPRS Networks Service (NS) messages on the Gb interface, 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05).

Macro Definition Documentation

◆ GRE_PTYPE_FR

#define GRE_PTYPE_FR   0x6559

◆ GRE_PTYPE_IPv4

#define GRE_PTYPE_IPv4   0x0800

◆ GRE_PTYPE_KAR

#define GRE_PTYPE_KAR   0x0000 /* keepalive response */

◆ IPPROTO_GRE

#define IPPROTO_GRE   47

Function Documentation

◆ gprs_ns_frgre_listen()

◆ gprs_ns_frgre_sendmsg()

◆ handle_nsfrgre_read()

static int handle_nsfrgre_read ( struct osmo_fd bfd)
static

◆ handle_nsfrgre_write()

static int handle_nsfrgre_write ( struct osmo_fd bfd)
static

Referenced by nsfrgre_fd_cb().

◆ handle_rx_gre_ipv4()

static int handle_rx_gre_ipv4 ( struct osmo_fd bfd,
struct msgb msg,
struct iphdr *  iph,
struct gre_hdr greh 
)
static

◆ nsfrgre_fd_cb()

static int nsfrgre_fd_cb ( struct osmo_fd bfd,
unsigned int  what 
)
static

◆ read_nsfrgre_msg()

static struct msgb * read_nsfrgre_msg ( struct osmo_fd bfd,
int *  error,
struct sockaddr_in *  saddr 
)
static

Variable Documentation

◆ flags

uint16_t flags

◆ ptype

uint16_t ptype