libisdn
X213.c File Reference
#include <stdio.h>
#include <string.h>
#include "X213.h"
#include "ISO3166.h"
#include "utils/common.h"

Go to the source code of this file.

Data Structures

struct  nsap_afi_info

Defines

#define NSAP_IDI_X121_LEN   7 /* 7 octets: 14 digits */
#define NSAP_IDI_ISO_DCC_LEN   2 /* 2 octets: 3 digits + padding */
#define NSAP_IDI_F69_LEN   4 /* 4 octets: 8 digits */
#define NSAP_IDI_E163_LEN   6 /* 6 octets: 12 digits */
#define NSAP_IDI_E164_LEN   8 /* 8 octets: 15 digits + padding */
#define NSAP_IDI_ISO_6523_ICD_LEN   3 /* 3 octets: 6 digits */
#define NSAP_IDI_IANA_ICP_LEN   2 /* 2 octets: 4 digits */
#define NSAP_IDI_ITU_T_IND_LEN   3 /* 3 octets: 6 digits */
#define NSAP_IDI_LOCAL_LEN   0 /* no IDI */

Functions

int nsap_afi_valid (const char afi)
int nsap_decode (struct nsap_addr *addr, char *buf, int size)
int nsap_print (struct nsap_addr *addr, char *buf, int size)

Define Documentation

#define NSAP_IDI_E163_LEN   6 /* 6 octets: 12 digits */

Definition at line 25 of file X213.c.

#define NSAP_IDI_E164_LEN   8 /* 8 octets: 15 digits + padding */

Definition at line 26 of file X213.c.

#define NSAP_IDI_F69_LEN   4 /* 4 octets: 8 digits */

Definition at line 24 of file X213.c.

#define NSAP_IDI_IANA_ICP_LEN   2 /* 2 octets: 4 digits */

Definition at line 28 of file X213.c.

#define NSAP_IDI_ISO_6523_ICD_LEN   3 /* 3 octets: 6 digits */

Definition at line 27 of file X213.c.

#define NSAP_IDI_ISO_DCC_LEN   2 /* 2 octets: 3 digits + padding */

Definition at line 23 of file X213.c.

#define NSAP_IDI_ITU_T_IND_LEN   3 /* 3 octets: 6 digits */

Definition at line 29 of file X213.c.

#define NSAP_IDI_LOCAL_LEN   0 /* no IDI */

Definition at line 30 of file X213.c.

#define NSAP_IDI_X121_LEN   7 /* 7 octets: 14 digits */

Definition at line 22 of file X213.c.


Function Documentation

int nsap_afi_valid ( const char  afi)

Check whether NSAP AFI can be decoded

Parameters:
[in]afiAFI to check
Returns:
true (1) or false (0)

Definition at line 340 of file X213.c.

Referenced by Q931Die_CalledSub().

int nsap_print ( struct nsap_addr addr,
char *  buf,
int  size 
)

Create textual representation of NSAP address

Parameters:
[in]addrNSAP address
[out]bufOutput buffer
[in]sizeSize of output buffer
Returns:
NSAPE_NO_ERROR on success, NSAPE_* otherwise

Definition at line 405 of file X213.c.

References nsap_addr::dsp, nsap_addr::idi, NSAP_DSP_DECIMAL, NSAP_IDI_E163, NSAP_IDI_E164, NSAP_IDI_F69, NSAP_IDI_IANA_ICP, NSAP_IDI_ISO_6523_ICD, NSAP_IDI_ISO_DCC, NSAP_IDI_ITU_T_IND, NSAP_IDI_LOCAL, NSAP_IDI_X121, and NSAPE_NO_ERROR.

Referenced by Q931Die_CalledSub().