The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions | Variables
sccp.c File Reference

Implement SCCP/TCAP glue layer. More...

#include <osmocom/core/talloc.h>
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/utils.h>
#include "sigtran.h"
#include "libosmo-m3ua/include/cellmgr_debug.h"
#include "libosmo-m3ua/include/mtp_data.h"
#include "libosmo-m3ua/include/sctp_m3ua.h"
+ Include dependency graph for sccp.c:

Go to the source code of this file.

Macros

#define LOG_PREFIX   "sigtran - osmocom thread"
 
#define sigtran_memdup(_x)
 

Functions

void sigtran_sccp_global_free (void)
 
int sigtran_sccp_global_init (void)
 
void sigtran_sccp_incoming (UNUSED struct mtp_link_set *set, struct msgb *msg, UNUSED int sls)
 Wrapper to pass data off to libsccp for processing. More...
 
static void sigtran_sccp_outgoing (UNUSED struct sccp_connection *sscp_conn, struct msgb *msg, UNUSED void *write_ctx, void *ctx)
 Wrapper to pass data down to MTP3 layer for processing. More...
 
int sigtran_sscp_init (sigtran_conn_t *conn)
 Initialise libscctp. More...
 
static int sigtran_tcap_incoming (struct msgb *msg, UNUSED unsigned int length, UNUSED void *ctx)
 Incoming data. More...
 
int sigtran_tcap_outgoing (UNUSED struct msgb *msg_in, void *ctx, sigtran_transaction_t *txn, UNUSED struct osmo_fd *ofd)
 Send a request with static MAP data in it. More...
 
static void sigtran_tcap_timeout (void *data)
 
static int sigtran_txn_cmp (void const *one, void const *two)
 Compare rounds of a transaction. More...
 

Variables

static uint32_t last_txn_id = 0
 Global transaction ID. More...
 
static fr_rb_tree_ttxn_tree = NULL
 Global transaction tree... Should really be per module. More...
 
static uint32_t txn_tree_inst = 0
 

Detailed Description

Implement SCCP/TCAP glue layer.

Id
7911a8da148463176e4344fea79a2347e63d30f6
Author
Arran Cudbard-Bell

Definition in file sccp.c.

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   "sigtran - osmocom thread"

Definition at line 37 of file sccp.c.

◆ sigtran_memdup

#define sigtran_memdup (   _x)
Value:
do { \
p++; \
DEBUG4("Start 0x%02x len %u", (unsigned int)(tcap - p), p[0]); \
if (p[0] >= (len - (p - tcap))) { \
ERROR("Invalid length %u specified for vector component", p[0]); \
return -1; \
} \
vec->_x = talloc_memdup(vec, p + 1, p[0]); \
talloc_set_type(vec->_x, uint8_t); \
p += p[0] + 1; \
} while (0)
unsigned char uint8_t
Definition: merged_model.c:30

Function Documentation

◆ sigtran_sccp_global_free()

void sigtran_sccp_global_free ( void  )

Definition at line 385 of file sccp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sigtran_sccp_global_init()

int sigtran_sccp_global_init ( void  )

Definition at line 371 of file sccp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sigtran_sccp_incoming()

void sigtran_sccp_incoming ( UNUSED struct mtp_link_set *  set,
struct msgb *  msg,
UNUSED int  sls 
)

Wrapper to pass data off to libsccp for processing.

Parameters
setLink set data was received on.
msgData from the lower layer.
slsLink number the data was received on.

Definition at line 352 of file sccp.c.

+ Here is the caller graph for this function:

◆ sigtran_sccp_outgoing()

static void sigtran_sccp_outgoing ( UNUSED struct sccp_connection *  sscp_conn,
struct msgb *  msg,
UNUSED void *  write_ctx,
void *  ctx 
)
static

Wrapper to pass data down to MTP3 layer for processing.

This is the write callback for the SCCP Code.

Definition at line 336 of file sccp.c.

+ Here is the caller graph for this function:

◆ sigtran_sscp_init()

int sigtran_sscp_init ( sigtran_conn_t conn)

Initialise libscctp.

Definition at line 360 of file sccp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sigtran_tcap_incoming()

static int sigtran_tcap_incoming ( struct msgb *  msg,
UNUSED unsigned int  length,
UNUSED void *  ctx 
)
static

Incoming data.

This should be called by the SCCP functions to give us result data

Definition at line 215 of file sccp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sigtran_tcap_outgoing()

int sigtran_tcap_outgoing ( UNUSED struct msgb *  msg_in,
void *  ctx,
sigtran_transaction_t txn,
UNUSED struct osmo_fd *  ofd 
)

Send a request with static MAP data in it.

SCCP will add its headers and call sigtran_sccp_outgoing

Returns
  • 0 on success.
  • <0 on failure.

Definition at line 98 of file sccp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sigtran_tcap_timeout()

static void sigtran_tcap_timeout ( void *  data)
static

Definition at line 71 of file sccp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sigtran_txn_cmp()

static int sigtran_txn_cmp ( void const *  one,
void const *  two 
)
static

Compare rounds of a transaction.

Definition at line 61 of file sccp.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ last_txn_id

uint32_t last_txn_id = 0
static

Global transaction ID.

Definition at line 54 of file sccp.c.

◆ txn_tree

fr_rb_tree_t* txn_tree = NULL
static

Global transaction tree... Should really be per module.

Definition at line 55 of file sccp.c.

◆ txn_tree_inst

uint32_t txn_tree_inst = 0
static

Definition at line 56 of file sccp.c.