SWILIB API (X75)    
Loading...
Searching...
No Matches
GPRS

Detailed Description

GPRS related functions.

See GprsD.elf sources for more info.

Usage: #include <swilib.h> or #include <swilib/gprs.h>

Data Structures

struct  REGSOCKCEPID_DATA
 CEPID registration data for sockets. More...
 
struct  LMAN_SOCKET_REG
 LMAN socket registration of a process (see RamSocketRegs). More...
 
struct  LMAN_CONTEXT
 LMAN context (see RamLmanContexts). More...
 
struct  LMAN_SOCKET_DESTINATION
 Where sockets of a process go (see LMAN_GetSocketDestination). More...
 
struct  ENIP_SOCKET_DESTINATION
 Socket destination passed to enip_sock_create. More...
 
struct  ENIP_ZDLL_ITEM
 ENIP list item, the first field of a listed object. More...
 
struct  ENIP_ZDLL_HEAD
 ENIP list (see zDLL_Init). More...
 
struct  ENIP_MODULE
 ENIP network module (see ENIP_ModuleInit). More...
 
struct  ENIP_PORT
 ENIP port: packet input of a module (see ENIP_PortInit). More...
 
struct  ENIP_PKT
 ENIP packet header (see ENIP_PacketAlloc). More...
 
struct  ENIP_TIMER
 ENIP timer (see enip_timer_init). More...
 
struct  ENIP_NSAPI_MODULE
 ENIP NSAPI module (see enip_nsapi_init_module). More...
 
struct  ENIP_IP_DRIVER
 ENIP IP driver: the network side of an interface (see ENIP_RegisterDriver). More...
 
struct  ENIP_IPH_INTERFACE
 ENIP IP interface: a registered driver (see ENIP_FindInterface). More...
 
struct  CTX_NAPDEF
 Network Access Point data. More...
 
struct  NAP_PARAM_CONT
 Network Access Point data container. More...
 
struct  LMAN_DATA
 LinkManager data. More...
 

Typedefs

typedef struct REGSOCKCEPID_DATA REGSOCKCEPID_DATA
 
typedef struct CTX_NAPDEF CTX_NAPDEF
 
typedef struct NAP_PARAM_CONT NAP_PARAM_CONT
 
typedef struct LMAN_DATA LMAN_DATA
 
typedef struct LMAN_SOCKET_REG LMAN_SOCKET_REG
 
typedef struct LMAN_CONTEXT LMAN_CONTEXT
 
typedef struct LMAN_SOCKET_DESTINATION LMAN_SOCKET_DESTINATION
 
typedef struct ENIP_ZDLL_ITEM ENIP_ZDLL_ITEM
 
typedef struct ENIP_ZDLL_HEAD ENIP_ZDLL_HEAD
 
typedef struct ENIP_MODULE ENIP_MODULE
 
typedef struct ENIP_PORT ENIP_PORT
 
typedef struct ENIP_PKT ENIP_PKT
 
typedef struct ENIP_TIMER ENIP_TIMER
 
typedef struct ENIP_NSAPI_MODULE ENIP_NSAPI_MODULE
 
typedef struct ENIP_IP_DRIVER ENIP_IP_DRIVER
 
typedef struct ENIP_IPH_INTERFACE ENIP_IPH_INTERFACE
 
typedef struct ENIP_SOCKET_DESTINATION ENIP_SOCKET_DESTINATION
 
typedef struct ENIP_SOCKET ENIP_SOCKET
 ENIP socket.
 

Enumerations

enum  LmanEventID {
  LMAN_CONNECT_CNF = 0x80 ,
  LMAN_CONNECT_REJ_IND = 0x81 ,
  LMAN_DISCONNECT_IND = 0x82 ,
  LMAN_DISCONNECT_CNF = 0x84 ,
  LMAN_LINK_UP_IND = 0x89
}
 LinkManager GBS events. More...
 
enum  EnipEventID {
  ENIP_BUFFER_FREE = 0x8A ,
  ENIP_BUFFER_FREE1 = 0x8B ,
  ENIP_SOCK_DATA_READ = 0x8C ,
  ENIP_SOCK_CONNECTED = 0x8D ,
  ENIP_SOCK_CLOSED = 0x8E ,
  ENIP_SOCK_REMOTE_CLOSED = 0x8F ,
  ENIP_SOCK_ACCEPTED = 0x90 ,
  ENIP_SOCK_ICMP_ERROR = 0x91 ,
  ENIP_DNR_HOST_BY_NAME = 0x94
}
 ENIP GBS events. More...
 

General functions

char IsGPRSEnabled (void)
 Check if GPRS enabled.
 
char IsGPRSAvailable (void)
 Check if GPRS available in the current network.
 
char IsEDGEAvailable (void)
 Check if EDGE is available in the current network.
 
char IsGPRSConnected (void)
 Check if the GPRS session is established.
 
void GPRS_OnOff (int enable, int unk)
 Enable or disable GPRS internet.
 
int GetCurrentGPRSProfile (void)
 Get an ID of the active internet profile.
 
int SetCurrentGPRSProfile (int profile_id)
 Change current internet profile.
 

SGOLD-only functions

int ActivateDialUpProfile (uint32_t cepid, int profile_id)
 Activate internet profile.
 
void RegisterCepIdForCurProfile (uint32_t cepid, int profile_id, uint32_t is_gprs)
 Register CEPID for internet profile.
 
int GetDisconnectTime (void)
 Get internet connection timeout for disconnect when there is no activity.
 

NewSGOLD-only functions

int RegisterCepidForSocketWork (REGSOCKCEPID_DATA *reg)
 Register current CEPID for sockets.
 
int RequestLMANConnect (LMAN_DATA *data)
 Connect to the GPRS.
 
int RequestLMANDisconnect (const uint8_t *req)
 Request disconnection of a native LMAN context.
 
unsigned GetSocketRegIndex (unsigned cepid)
 Find the socket-registration slot for a CEPID.
 
unsigned GetServiceCepid (unsigned service)
 Get the process identifier assigned to a native service.
 
unsigned LMAN_AllocContext (unsigned bearer, uint8_t type)
 Allocate a native LMAN context.
 
void LMAN_SetRef (unsigned reg_index, unsigned cid, int on)
 Attach or detach a registered process from an LMAN context.
 
void LMAN_SetState (unsigned cid, int state)
 Change a native LMAN context state and notify its registered owners.
 
void LMAN_FreeContext (unsigned cid)
 Reset and release a native LMAN context without disconnecting a physical bearer.
 
LMAN_CONTEXT * RamLmanContexts (void)
 Get the LMAN context table.
 
uint32_t * RamLmanRefs (void)
 Get the LMAN process-to-context reference table.
 
LMAN_SOCKET_REG * RamSocketRegs (void)
 Get the LMAN socket registration table.
 
void * WSP_GetObject (unsigned id)
 Get a WSP object.
 
int WSP_ReadProperty (const char *key, void *value, unsigned *length)
 Read a WSP property.
 
void ENIP_ModuleInit (ENIP_MODULE *module, const char *name, int(*up)(ENIP_MODULE *module), void(*down)(ENIP_MODULE *module, uint32_t reason), void(*run)(ENIP_MODULE *module), void(*notify)(ENIP_MODULE *module, int event), void(*post_run)(ENIP_MODULE *module), void(*packet_available)(ENIP_MODULE *module, uint8_t pool))
 Initialize an ENIP network module (the driver side of a network interface).
 
uint8_t ENIP_ModuleRun (ENIP_MODULE *module, uint32_t *result)
 Run an ENIP network module once.
 
int ENIP_ModuleUp (ENIP_MODULE *module)
 Bring an ENIP network module up.
 
void ENIP_ModuleDown (ENIP_MODULE *module, uint32_t reason)
 Bring an ENIP network module down.
 
void ENIP_PortInit (ENIP_PORT *port, ENIP_MODULE *module)
 Initialize the packet port of an ENIP network module.
 
void ENIP_PortSend (ENIP_PORT *port, ENIP_PKT *packet)
 Queue a packet on an ENIP port.
 
ENIP_PKT * ENIP_PacketAlloc (ENIP_MODULE *module, int size, uint32_t pool, int offset, int quota)
 Allocate an ENIP packet.
 
void ENIP_PacketFree (ENIP_PKT *packet)
 Free an ENIP packet.
 
int ENIP_RegisterDriver (ENIP_IP_DRIVER *driver, int flags)
 Register an IP driver (network interface) in the ENIP IP layer.
 
void ENIP_UnregisterDriver (ENIP_MODULE *module)
 Unregister the IP driver of an ENIP network module.
 
ENIP_IPH_INTERFACE * ENIP_FindInterface (uint32_t bearer, uint16_t iface)
 Find the IP interface of a bearer.
 
void LMAN_AttachInterface (unsigned cid, unsigned iface, unsigned unk)
 Attach an IP interface to a native LMAN context.
 
void * zDLL_RemHead (ENIP_ZDLL_HEAD *list)
 Remove the first item of an ENIP list (packet queue).
 
ENIP_IP_DRIVER * RamPdpDrivers (void)
 Get the GPRS PDP driver table (the DNS resolver takes servers for bearer 1 from it).
 
void enip_module_post_run (ENIP_MODULE *module)
 Schedule a run of an ENIP module: mark it as needing a run and call its post-run procedure if one is set, the module is up and no run is already posted or in progress.
 
void enip_module_nsapi_post_init (ENIP_NSAPI_MODULE *module)
 Reset the per-context fields of an NSAPI module after enip_nsapi_init_module.
 
void enip_port_handle_pkt (ENIP_PORT *port, ENIP_PKT *packet)
 Append a packet to an ENIP port's queue and schedule the port's module if the queue was empty.
 
void * enip_memory_allocate (uint32_t unused, int size)
 Allocate memory from the ENIP pool, falling back to the second ENIP pool.
 
void enip_memory_release (void *block)
 Release a block allocated with enip_memory_allocate.
 
int enip_packet_max_size (void)
 Get the largest ENIP packet size (a firmware constant).
 
int enip_ip_init (void(*post_run)(ENIP_MODULE *module))
 Initialise the ENIP IP module, its interface slots (8 on NSG/ELKA, 16 on SG/X75) and the 2 reassembly slots.
 
ENIP_IPH_INTERFACE * enip_find_iface_by_driver (ENIP_IP_DRIVER *driver)
 Find the IP interface whose registered driver belongs to the same module as the given driver.
 
void enip_iph_calc_chk_and_port_send (ENIP_PORT **port, ENIP_PKT *packet, uint32_t size)
 Fill the IPv4 header checksum of a packet, set its size and send it to a port.
 
uint16_t enip_iph_compute_checksum (uint16_t seed, const void *data, uint16_t size)
 Compute the Internet (one's complement) checksum of a buffer.
 
ENIP_IPH_INTERFACE * enip_iph_find_IF_for_socket (ENIP_SOCKET *socket)
 Find the IP interface whose bearer ID and interface index equal the socket's LMAN destination.
 
void enip_iph_frame_read (ENIP_PKT *packet)
 Process a received IP packet: check the IPv4 header, find the interface, reassemble fragments and pass the packet to the protocol handler.
 
int enip_iph_manage_reassembly (ENIP_IPH_INTERFACE *iface, ENIP_PKT *packet, uint8_t *header, uint32_t total_size, uint32_t header_size, uint32_t fragment, int source)
 Add an IPv4 fragment to its reassembly slot.
 
void enip_iph_packet_avail (void)
 Notify the IP layer that a packet buffer is free again.
 
void enip_iph_rheader_init (void *slot)
 Reset an IPv4 reassembly slot and its timer.
 
void enip_iph_run (ENIP_MODULE *module)
 Run procedure of the IP module: expire socket timers and handle queued packets.
 
int enip_iph_write (ENIP_PORT **port, ENIP_PKT *packet, uint32_t size)
 Send a packet from the IP layer: fill the header checksum and pass it to the port.
 
int enip_siph_crypt_frame_read (ENIP_IPH_INTERFACE *iface, ENIP_PKT *packet)
 Receive handler of the secure IP layer: answers a special 8-byte ICMP probe (type 0x49, code 0x44, id 1) in place with "SCRN\3\0".
 
ENIP_IPH_INTERFACE * enip_siph_find_IF (int address)
 Find the IP interface with the given local address.
 
void enip_icmp_frame_read (ENIP_IPH_INTERFACE *iface, ENIP_PKT *packet)
 Process a received ICMP packet and release it.
 
void enip_udph_frame_read (ENIP_IPH_INTERFACE *iface, ENIP_PKT *packet)
 Process a received UDP packet: check it and queue it on the matching socket.
 
int enip_init_csd_iface (ENIP_MODULE *module, ENIP_IP_DRIVER *driver)
 Fill an IP driver description for the CSD (PPP dial-up) interface.
 
int enip_nsapi_init_iface (ENIP_NSAPI_MODULE *module)
 Create and register the IP interface of a PDP context (NSAPI module).
 
int enip_nsapi_init_module (ENIP_NSAPI_MODULE *module)
 Initialise an NSAPI (PDP context) module named "NSAPI".
 
void ENIP_PDP_NET_UP_CNF (uint16_t context, int result)
 ENIP handler of the PDP NET_UP confirmation.
 
void ENIP_PDP_NET_UP_REJ_IND (uint16_t context, int result)
 ENIP handler of the PDP NET_UP reject indication.
 
void ENIP_PDP_NET_DOWN_IND (uint16_t context, int mode)
 ENIP handler of the PDP NET_DOWN indication: take the context's interface down.
 
void ENIP_PDP_START_REQ (int context, int mode)
 ENIP handler of the PDP start request: initialise and bring up the context's NSAPI module.
 
void ENIP_PDP_STOP_REQ (uint16_t context, int mode)
 ENIP handler of the PDP stop request.
 
void ENIP_PDP_START_CSD_INT_REQ (int bearer)
 ENIP handler of the CSD (PPP dial-up) start request: set up the "PPP CSD" module.
 
int enip_sock_create (int family, int type, int protocol, int *socket_id, uint32_t param, const ENIP_SOCKET_DESTINATION *destination)
 Create an ENIP socket.
 
int enip_socket_connect (int socket, int address, int unknown, uint16_t port, uint32_t timeout)
 Connect a socket: set the peer of a datagram socket or start a TCP connection.
 
void enip_sockh_IF_init (ENIP_IPH_INTERFACE *iface)
 Pick a pseudo-random first local port for an interface.
 
ENIP_SOCKET * enip_sockh_create_internal (int family, int type, int protocol, int *socket_id, uint32_t param1, uint32_t param2)
 Allocate and initialise a socket in a free slot of the socket table.
 
int enip_sockh_autobind_IF (ENIP_SOCKET *socket, int address)
 Bind a socket to an IP interface: the one matching its LMAN destination, or the first usable one.
 
int enip_sockh_packet_allocate (ENIP_SOCKET *socket, uint32_t size, uint32_t pool, ENIP_PKT **packet, int timeout)
 Allocate an outgoing packet for a socket with room for the interface headers.
 
int enip_sockh_dgram_connect (ENIP_SOCKET *socket, int address, uint32_t unused, uint16_t port)
 Set the peer of a datagram socket.
 
int enip_sockh_prepare_send (int index, ENIP_SOCKET *socket, uint32_t address)
 Fill the IPv4 header of an outgoing packet from the socket's settings.
 
int enip_tcph_sock_init (ENIP_SOCKET *socket)
 Initialise the TCP state of a socket: initial sequence number, windows and MSS.
 
int enip_tcph_sock_connect (ENIP_SOCKET *socket, int address, uint32_t unknown, uint16_t port, uint32_t timeout)
 Start a TCP connection: send SYN and start the connect timer.
 
int enip_tcph_send_segment (ENIP_SOCKET *socket, uint32_t flags, const void *data, uint32_t size, ENIP_PKT *packet, int unknown)
 Build and send one TCP segment.
 
void enip_tcph_write_segment (ENIP_SOCKET *socket, ENIP_PKT *packet, int use_sequence)
 Fill in the TCP header of an outgoing segment of the socket and send it.
 
void enip_tcph_change_sock_state (ENIP_SOCKET *socket, uint32_t state)
 Change the TCP state of a socket and notify its owner.
 
void enip_tcph_frame_read (ENIP_IPH_INTERFACE *iface, ENIP_PKT *packet)
 Process a received TCP segment.
 
void enip_tcph_run (void)
 Check the TCP timers of all sockets: retransmit, time out or move on in the close states.
 
uint32_t enip_tcph_get_SACK_option_from_list (ENIP_SOCKET *socket, uint32_t count, uint8_t *option)
 Write a TCP SACK option (NOP, NOP, SACK) from the socket's SACK blocks.
 
void enip_tcph_update_SACK_block_list (ENIP_SOCKET *socket)
 Remove the SACK blocks that are already acknowledged.
 
void enip_timer_init (ENIP_TIMER *timer, ENIP_MODULE *module)
 Initialise an ENIP timer.
 
void enip_timer_cancel (ENIP_TIMER *timer)
 Stop an ENIP timer if it is running.
 
void enip_timer_start (ENIP_TIMER *timer, uint32_t timeout)
 Start or restart an ENIP timer and schedule its module.
 
void LMAN_LINK_UP_CNF (void)
 LMAN handler of the link-up confirmation: mark the waiting connection as up and notify the owner.
 
void LMAN_FreeSocketReg (unsigned index)
 Free an LMAN socket registration (see RamSocketRegs).
 
uint16_t LMAN_FindContext (uint16_t bearer, uint16_t iface)
 Find the LMAN context with the given bearer ID and interface.
 
uint8_t LMAN_GetBearerIdForCi (uint16_t cid)
 Get the bearer ID of an LMAN context.
 
int LMAN_GetSocketDestination (uint16_t cepid, LMAN_SOCKET_DESTINATION *destination)
 Get where sockets of a process go: application flags, selector, bearer ID and interface index.
 
void zDLL_Init (ENIP_ZDLL_HEAD *list)
 Initialise an empty ENIP double-linked list (two pointers: first, last).
 

Profile

const char * RamActiveGPRSProfileName (void)
 Get name of the current internet profile.
 

Statistic

void RefreshGPRSTraffic ()
 Refresh the GPRS traffic counter.
 
void ResetGPRSTraffic (void)
 Reset the GPRS traffic counter.
 
int * GetGPRSTrafficPointer ()
 Get traffic used by GPRS.
 
unsigned LMAN_GetOrAllocSocketRegIndex (unsigned cepid)
 Find the LMAN socket registration (see RamSocketRegs) of a process or take a free one.
 
int LMAN_SetSocketReg (unsigned index, const REGSOCKCEPID_DATA *reg, int keep)
 Set the data of an LMAN socket registration, as RegisterCepidForSocketWork does for the current process.
 

Data Structure Documentation

◆ REGSOCKCEPID_DATA

struct REGSOCKCEPID_DATA

◆ LMAN_SOCKET_REG

struct LMAN_SOCKET_REG

◆ LMAN_CONTEXT

struct LMAN_CONTEXT

◆ LMAN_SOCKET_DESTINATION

struct LMAN_SOCKET_DESTINATION

◆ ENIP_SOCKET_DESTINATION

struct ENIP_SOCKET_DESTINATION

◆ ENIP_ZDLL_ITEM

struct ENIP_ZDLL_ITEM

◆ ENIP_ZDLL_HEAD

struct ENIP_ZDLL_HEAD

◆ ENIP_MODULE

struct ENIP_MODULE

◆ ENIP_PORT

struct ENIP_PORT

◆ ENIP_PKT

struct ENIP_PKT

◆ ENIP_TIMER

struct ENIP_TIMER

◆ ENIP_NSAPI_MODULE

struct ENIP_NSAPI_MODULE

◆ ENIP_IP_DRIVER

struct ENIP_IP_DRIVER

◆ ENIP_IPH_INTERFACE

struct ENIP_IPH_INTERFACE

◆ CTX_NAPDEF

struct CTX_NAPDEF

◆ NAP_PARAM_CONT

struct NAP_PARAM_CONT

◆ LMAN_DATA

struct LMAN_DATA

Typedef Documentation

◆ REGSOCKCEPID_DATA

typedef struct REGSOCKCEPID_DATA REGSOCKCEPID_DATA

Definition at line 19 of file gprs.h.

◆ CTX_NAPDEF

typedef struct CTX_NAPDEF CTX_NAPDEF

Definition at line 20 of file gprs.h.

◆ NAP_PARAM_CONT

typedef struct NAP_PARAM_CONT NAP_PARAM_CONT

Definition at line 21 of file gprs.h.

◆ LMAN_DATA

typedef struct LMAN_DATA LMAN_DATA

Definition at line 22 of file gprs.h.

◆ LMAN_SOCKET_REG

typedef struct LMAN_SOCKET_REG LMAN_SOCKET_REG

Definition at line 23 of file gprs.h.

◆ LMAN_CONTEXT

typedef struct LMAN_CONTEXT LMAN_CONTEXT

Definition at line 24 of file gprs.h.

◆ LMAN_SOCKET_DESTINATION

typedef struct LMAN_SOCKET_DESTINATION LMAN_SOCKET_DESTINATION

Definition at line 25 of file gprs.h.

◆ ENIP_ZDLL_ITEM

typedef struct ENIP_ZDLL_ITEM ENIP_ZDLL_ITEM

Definition at line 26 of file gprs.h.

◆ ENIP_ZDLL_HEAD

typedef struct ENIP_ZDLL_HEAD ENIP_ZDLL_HEAD

Definition at line 27 of file gprs.h.

◆ ENIP_MODULE

typedef struct ENIP_MODULE ENIP_MODULE

Definition at line 28 of file gprs.h.

◆ ENIP_PORT

typedef struct ENIP_PORT ENIP_PORT

Definition at line 29 of file gprs.h.

◆ ENIP_PKT

typedef struct ENIP_PKT ENIP_PKT

Definition at line 30 of file gprs.h.

◆ ENIP_TIMER

typedef struct ENIP_TIMER ENIP_TIMER

Definition at line 31 of file gprs.h.

◆ ENIP_NSAPI_MODULE

typedef struct ENIP_NSAPI_MODULE ENIP_NSAPI_MODULE

Definition at line 32 of file gprs.h.

◆ ENIP_IP_DRIVER

typedef struct ENIP_IP_DRIVER ENIP_IP_DRIVER

Definition at line 33 of file gprs.h.

◆ ENIP_IPH_INTERFACE

typedef struct ENIP_IPH_INTERFACE ENIP_IPH_INTERFACE

Definition at line 34 of file gprs.h.

◆ ENIP_SOCKET_DESTINATION

typedef struct ENIP_SOCKET_DESTINATION ENIP_SOCKET_DESTINATION

Definition at line 35 of file gprs.h.

◆ ENIP_SOCKET

typedef struct ENIP_SOCKET ENIP_SOCKET

ENIP socket.

Its layout differs between NSG/ELKA and SG/X75.

Definition at line 40 of file gprs.h.

Enumeration Type Documentation

◆ LmanEventID

LinkManager GBS events.

Enumerator
LMAN_CONNECT_CNF 
LMAN_CONNECT_REJ_IND 
LMAN_DISCONNECT_IND 
LMAN_DISCONNECT_CNF 
LMAN_LINK_UP_IND 

Definition at line 45 of file gprs.h.

◆ EnipEventID

ENIP GBS events.

Enumerator
ENIP_BUFFER_FREE 
ENIP_BUFFER_FREE1 
ENIP_SOCK_DATA_READ 
ENIP_SOCK_CONNECTED 
ENIP_SOCK_CLOSED 
ENIP_SOCK_REMOTE_CLOSED 
ENIP_SOCK_ACCEPTED 
ENIP_SOCK_ICMP_ERROR 
ENIP_DNR_HOST_BY_NAME 

Definition at line 56 of file gprs.h.

Function Documentation

◆ IsGPRSEnabled()

char IsGPRSEnabled ( void )

Check if GPRS enabled.

Returns
1 or 0

◆ IsGPRSAvailable()

char IsGPRSAvailable ( void )

Check if GPRS available in the current network.

Returns
1 or 0

◆ IsEDGEAvailable()

char IsEDGEAvailable ( void )

Check if EDGE is available in the current network.

Returns
1 or 0
Available on platforms:
NSG, ELKA

◆ IsGPRSConnected()

char IsGPRSConnected ( void )

Check if the GPRS session is established.

Returns
1 or 0

◆ GPRS_OnOff()

void GPRS_OnOff ( int enable,
int unk )

Enable or disable GPRS internet.

Parameters
enable1 or 0
unkset to 1

◆ GetCurrentGPRSProfile()

int GetCurrentGPRSProfile ( void )

Get an ID of the active internet profile.

Returns
ID
Available on platforms:
X75, SG
Warning
SGOLD only

◆ SetCurrentGPRSProfile()

int SetCurrentGPRSProfile ( int profile_id)

Change current internet profile.

Parameters
profile_idID of the profile
Returns
status
Available on platforms:
X75, SG
Warning
SGOLD only

◆ ActivateDialUpProfile()

int ActivateDialUpProfile ( uint32_t cepid,
int profile_id )

Activate internet profile.

Parameters
cepidcurrent CEPID, use GBS_GetCurCepid
profile_idGPRS profile ID, use GetCurrentGPRSProfile
Returns
status
Available on platforms:
X75, SG
Warning
SGOLD only, call only from SUBPROC.

◆ RegisterCepIdForCurProfile()

void RegisterCepIdForCurProfile ( uint32_t cepid,
int profile_id,
uint32_t is_gprs )

Register CEPID for internet profile.

Parameters
cepidcurrent CEPID, use GBS_GetCurCepid
profile_idGPRS profile ID, use GetCurrentGPRSProfile
is_gprsconnection type, 1: GPRS, 0: CSD
Available on platforms:
X75, SG
Warning
SGOLD only, call only from SUBPROC.

◆ GetDisconnectTime()

int GetDisconnectTime ( void )

Get internet connection timeout for disconnect when there is no activity.

Returns
seconds
Available on platforms:
X75, SG
Warning
SGOLD only

◆ RegisterCepidForSocketWork()

int RegisterCepidForSocketWork ( REGSOCKCEPID_DATA * reg)

Register current CEPID for sockets.

Parameters
regpointer to the REGSOCKCEPID_DATA
Returns
1: success, 0: error
Warning
Call only from SUBPROC.

◆ RequestLMANConnect()

int RequestLMANConnect ( LMAN_DATA * data)

Connect to the GPRS.

Parameters
datapointer to the LMAN_DATA
Returns
LMAN connect ID
Warning
Call only from SUBPROC, NewSGOLD only.

◆ RequestLMANDisconnect()

int RequestLMANDisconnect ( const uint8_t * req)

Request disconnection of a native LMAN context.

Parameters
reqtwo request bytes: context ID, then disconnect cause
Returns
1 if handled, 0 if rejected. Call from a process registered for socket work

◆ GetSocketRegIndex()

unsigned GetSocketRegIndex ( unsigned cepid)

Find the socket-registration slot for a CEPID.

Parameters
cepidGBS process identifier
Returns
registration index 0..13, or 0xFFFF if not registered

◆ GetServiceCepid()

unsigned GetServiceCepid ( unsigned service)

Get the process identifier assigned to a native service.

Parameters
servicefirmware service index; 3 selects the Java service
Returns
service CEPID, or 0 if unavailable

◆ LMAN_AllocContext()

unsigned LMAN_AllocContext ( unsigned bearer,
uint8_t type )

Allocate a native LMAN context.

Parameters
bearernative bearer kind; 1 selects GPRS
typecontext subtype
Returns
context index 0..7. Check for a free context before calling; a full table asserts

◆ LMAN_SetRef()

void LMAN_SetRef ( unsigned reg_index,
unsigned cid,
int on )

Attach or detach a registered process from an LMAN context.

Parameters
reg_indexsocket-registration index 0..13
cidcontext index 0..7
on1 to attach, 0 to detach

◆ LMAN_SetState()

void LMAN_SetState ( unsigned cid,
int state )

Change a native LMAN context state and notify its registered owners.

Parameters
cidcontext index 0..7
statenative state value; 4 means connected

◆ LMAN_FreeContext()

void LMAN_FreeContext ( unsigned cid)

Reset and release a native LMAN context without disconnecting a physical bearer.

Parameters
cidcontext index 0..7

◆ RamLmanContexts()

LMAN_CONTEXT * RamLmanContexts ( void )

Get the LMAN context table.

Returns
8 entries

◆ RamLmanRefs()

uint32_t * RamLmanRefs ( void )

Get the LMAN process-to-context reference table.

Returns
14 rows of 8 reference words, indexed by registration slot and context ID

◆ RamSocketRegs()

LMAN_SOCKET_REG * RamSocketRegs ( void )

Get the LMAN socket registration table.

Returns
14 entries

◆ WSP_GetObject()

void * WSP_GetObject ( unsigned id)

Get a WSP object.

Parameters
idobject ID, 0x17: preferences, 0x18: network policy
Returns
pointer to the object or NULL

◆ WSP_ReadProperty()

int WSP_ReadProperty ( const char * key,
void * value,
unsigned * length )

Read a WSP property.

Parameters
keyproperty name
valueoutput buffer
lengthbuffer size, receives the value length
Returns
1: success, 0: error

◆ ENIP_ModuleInit()

void ENIP_ModuleInit ( ENIP_MODULE * module,
const char * name,
int(* up )(ENIP_MODULE *module),
void(* down )(ENIP_MODULE *module, uint32_t reason),
void(* run )(ENIP_MODULE *module),
void(* notify )(ENIP_MODULE *module, int event),
void(* post_run )(ENIP_MODULE *module),
void(* packet_available )(ENIP_MODULE *module, uint8_t pool) )

Initialize an ENIP network module (the driver side of a network interface).

Parameters
modulemodule object, filled by the firmware
namemodule name
upcalled when the module goes up
downcalled when the module goes down
runmodule run callback
notifyevent callback (module, event)
post_runcalled after run
packet_availablecalled when a packet is queued on the module port

◆ ENIP_ModuleRun()

uint8_t ENIP_ModuleRun ( ENIP_MODULE * module,
uint32_t * result )

Run an ENIP network module once.

Call from the ENIP process.

Parameters
modulemodule object
[out]resultrun result
Returns
module state

◆ ENIP_ModuleUp()

int ENIP_ModuleUp ( ENIP_MODULE * module)

Bring an ENIP network module up.

Parameters
modulemodule object
Returns
result code

◆ ENIP_ModuleDown()

void ENIP_ModuleDown ( ENIP_MODULE * module,
uint32_t reason )

Bring an ENIP network module down.

Parameters
modulemodule object
reasonreason code, 0: normal

◆ ENIP_PortInit()

void ENIP_PortInit ( ENIP_PORT * port,
ENIP_MODULE * module )

Initialize the packet port of an ENIP network module.

Parameters
portport object inside the module
moduleowning module

◆ ENIP_PortSend()

void ENIP_PortSend ( ENIP_PORT * port,
ENIP_PKT * packet )

Queue a packet on an ENIP port.

The port takes ownership of the packet.

Parameters
portdestination port
packetpacket from ENIP_PacketAlloc

◆ ENIP_PacketAlloc()

ENIP_PKT * ENIP_PacketAlloc ( ENIP_MODULE * module,
int size,
uint32_t pool,
int offset,
int quota )

Allocate an ENIP packet.

Parameters
moduleowning module
sizebuffer size
poolbuffer pool
offsetdata offset in the buffer
quotaallocation quota (ignored on SG/X75)
Returns
packet, or NULL if no memory

◆ ENIP_PacketFree()

void ENIP_PacketFree ( ENIP_PKT * packet)

Free an ENIP packet.

Parameters
packetpacket from ENIP_PacketAlloc

◆ ENIP_RegisterDriver()

int ENIP_RegisterDriver ( ENIP_IP_DRIVER * driver,
int flags )

Register an IP driver (network interface) in the ENIP IP layer.

Parameters
driverdriver object: ports, addresses, DNS, MTU, bearer and interface index
flags0 (ignored on SG/X75)
Returns
1: success

◆ ENIP_UnregisterDriver()

void ENIP_UnregisterDriver ( ENIP_MODULE * module)

Unregister the IP driver of an ENIP network module.

Parameters
modulemodule of the registered driver

◆ ENIP_FindInterface()

ENIP_IPH_INTERFACE * ENIP_FindInterface ( uint32_t bearer,
uint16_t iface )

Find the IP interface of a bearer.

Parameters
bearerbearer ID
ifaceinterface index
Returns
interface object, or NULL

◆ LMAN_AttachInterface()

void LMAN_AttachInterface ( unsigned cid,
unsigned iface,
unsigned unk )

Attach an IP interface to a native LMAN context.

Parameters
cidcontext ID from LMAN_AllocContext
ifaceinterface index
unk0xFFFF

◆ zDLL_RemHead()

void * zDLL_RemHead ( ENIP_ZDLL_HEAD * list)

Remove the first item of an ENIP list (packet queue).

Parameters
listlist head
Returns
removed item, or NULL if the list is empty

◆ RamPdpDrivers()

ENIP_IP_DRIVER * RamPdpDrivers ( void )

Get the GPRS PDP driver table (the DNS resolver takes servers for bearer 1 from it).

Returns
driver entries

◆ enip_module_post_run()

void enip_module_post_run ( ENIP_MODULE * module)

Schedule a run of an ENIP module: mark it as needing a run and call its post-run procedure if one is set, the module is up and no run is already posted or in progress.

Parameters
moduleENIP module

◆ enip_module_nsapi_post_init()

void enip_module_nsapi_post_init ( ENIP_NSAPI_MODULE * module)

Reset the per-context fields of an NSAPI module after enip_nsapi_init_module.

Parameters
moduleNSAPI module

◆ enip_port_handle_pkt()

void enip_port_handle_pkt ( ENIP_PORT * port,
ENIP_PKT * packet )

Append a packet to an ENIP port's queue and schedule the port's module if the queue was empty.

Parameters
portENIP port
packetENIP packet

◆ enip_memory_allocate()

void * enip_memory_allocate ( uint32_t unused,
int size )

Allocate memory from the ENIP pool, falling back to the second ENIP pool.

Parameters
unusednot read by the function
sizesize in bytes
Returns
memory block, NULL when both pools are exhausted

◆ enip_memory_release()

void enip_memory_release ( void * block)

Release a block allocated with enip_memory_allocate.

NULL is a fatal error.

Parameters
blockmemory block

◆ enip_packet_max_size()

int enip_packet_max_size ( void )

Get the largest ENIP packet size (a firmware constant).

Returns
size in bytes

◆ enip_ip_init()

int enip_ip_init ( void(* post_run )(ENIP_MODULE *module))

Initialise the ENIP IP module, its interface slots (8 on NSG/ELKA, 16 on SG/X75) and the 2 reassembly slots.

Parameters
post_runpost-run procedure of the IP module (see ENIP_MODULE)
Returns
1

◆ enip_find_iface_by_driver()

ENIP_IPH_INTERFACE * enip_find_iface_by_driver ( ENIP_IP_DRIVER * driver)

Find the IP interface whose registered driver belongs to the same module as the given driver.

Parameters
driverENIP IP driver
Returns
IP interface, NULL when not found

◆ enip_iph_calc_chk_and_port_send()

void enip_iph_calc_chk_and_port_send ( ENIP_PORT ** port,
ENIP_PKT * packet,
uint32_t size )

Fill the IPv4 header checksum of a packet, set its size and send it to a port.

Parameters
portpointer to the destination ENIP port pointer
packetENIP packet with an IPv4 header at its data
sizepacket size in bytes

◆ enip_iph_compute_checksum()

uint16_t enip_iph_compute_checksum ( uint16_t seed,
const void * data,
uint16_t size )

Compute the Internet (one's complement) checksum of a buffer.

Parameters
seedchecksum of preceding data, 0 to start
datadata, summed as big-endian 16-bit words
sizesize in bytes
Returns
checksum, 0 when data already contains a correct checksum

◆ enip_iph_find_IF_for_socket()

ENIP_IPH_INTERFACE * enip_iph_find_IF_for_socket ( ENIP_SOCKET * socket)

Find the IP interface whose bearer ID and interface index equal the socket's LMAN destination.

Parameters
socketENIP socket
Returns
IP interface, NULL when not found

◆ enip_iph_frame_read()

void enip_iph_frame_read ( ENIP_PKT * packet)

Process a received IP packet: check the IPv4 header, find the interface, reassemble fragments and pass the packet to the protocol handler.

Parameters
packetENIP packet

◆ enip_iph_manage_reassembly()

int enip_iph_manage_reassembly ( ENIP_IPH_INTERFACE * iface,
ENIP_PKT * packet,
uint8_t * header,
uint32_t total_size,
uint32_t header_size,
uint32_t fragment,
int source )

Add an IPv4 fragment to its reassembly slot.

Parameters
ifacereceiving IP interface
packetENIP packet with the fragment
headerIPv4 header of the fragment
total_sizeIPv4 total length
header_sizeIPv4 header length
fragmentIPv4 flags and fragment offset field
sourcevalue matched against the slot owner (probably the source address)
Returns
complete packet, 0 while fragments are missing

◆ enip_iph_packet_avail()

void enip_iph_packet_avail ( void )

Notify the IP layer that a packet buffer is free again.

◆ enip_iph_rheader_init()

void enip_iph_rheader_init ( void * slot)

Reset an IPv4 reassembly slot and its timer.

Parameters
slotreassembly slot

◆ enip_iph_run()

void enip_iph_run ( ENIP_MODULE * module)

Run procedure of the IP module: expire socket timers and handle queued packets.

Parameters
moduleIP module

◆ enip_iph_write()

int enip_iph_write ( ENIP_PORT ** port,
ENIP_PKT * packet,
uint32_t size )

Send a packet from the IP layer: fill the header checksum and pass it to the port.

Parameters
portpointer to the destination ENIP port pointer
packetENIP packet, NULL only runs the pending output
sizepacket size in bytes
Returns
0 when a packet was given

◆ enip_siph_crypt_frame_read()

int enip_siph_crypt_frame_read ( ENIP_IPH_INTERFACE * iface,
ENIP_PKT * packet )

Receive handler of the secure IP layer: answers a special 8-byte ICMP probe (type 0x49, code 0x44, id 1) in place with "SCRN\3\0".

Parameters
ifacereceiving IP interface
packetENIP packet
Returns
1 when the probe was answered, 0 to pass the packet to enip_icmp_frame_read

◆ enip_siph_find_IF()

ENIP_IPH_INTERFACE * enip_siph_find_IF ( int address)

Find the IP interface with the given local address.

Parameters
addresslocal IPv4 address, network byte order
Returns
IP interface, NULL when not found

◆ enip_icmp_frame_read()

void enip_icmp_frame_read ( ENIP_IPH_INTERFACE * iface,
ENIP_PKT * packet )

Process a received ICMP packet and release it.

Replies to echo requests (type 8) and handles destination unreachable messages (type 3); other types are dropped.

Parameters
ifacereceiving IP interface
packetENIP packet, data at the ICMP header
Note
NSG/ELKA also handle source quench (type 4), time exceeded (type 11) and parameter problem (type 12).

◆ enip_udph_frame_read()

void enip_udph_frame_read ( ENIP_IPH_INTERFACE * iface,
ENIP_PKT * packet )

Process a received UDP packet: check it and queue it on the matching socket.

Parameters
ifacereceiving IP interface
packetENIP packet, data at the UDP header

◆ enip_init_csd_iface()

int enip_init_csd_iface ( ENIP_MODULE * module,
ENIP_IP_DRIVER * driver )

Fill an IP driver description for the CSD (PPP dial-up) interface.

Parameters
moduleCSD module
driverENIP IP driver to fill
Returns
1 when the module is up, otherwise 0

◆ enip_nsapi_init_iface()

int enip_nsapi_init_iface ( ENIP_NSAPI_MODULE * module)

Create and register the IP interface of a PDP context (NSAPI module).

Parameters
moduleNSAPI module
Returns
0 when the module is not up

◆ enip_nsapi_init_module()

int enip_nsapi_init_module ( ENIP_NSAPI_MODULE * module)

Initialise an NSAPI (PDP context) module named "NSAPI".

Parameters
moduleNSAPI module
Returns
1

◆ ENIP_PDP_NET_UP_CNF()

void ENIP_PDP_NET_UP_CNF ( uint16_t context,
int result )

ENIP handler of the PDP NET_UP confirmation.

Parameters
contextPDP context index
result1: OK

◆ ENIP_PDP_NET_UP_REJ_IND()

void ENIP_PDP_NET_UP_REJ_IND ( uint16_t context,
int result )

ENIP handler of the PDP NET_UP reject indication.

Parameters
contextPDP context index
resultmeaning not known; 1 releases the context

◆ ENIP_PDP_NET_DOWN_IND()

void ENIP_PDP_NET_DOWN_IND ( uint16_t context,
int mode )

ENIP handler of the PDP NET_DOWN indication: take the context's interface down.

Parameters
contextPDP context index
modemeaning not known (0 and 1 handled differently)

◆ ENIP_PDP_START_REQ()

void ENIP_PDP_START_REQ ( int context,
int mode )

ENIP handler of the PDP start request: initialise and bring up the context's NSAPI module.

Parameters
contextPDP context index
modemeaning not known (0: create the interface)

◆ ENIP_PDP_STOP_REQ()

void ENIP_PDP_STOP_REQ ( uint16_t context,
int mode )

ENIP handler of the PDP stop request.

Parameters
contextPDP context index
modemeaning not known (0 and 1 handled differently)

◆ ENIP_PDP_START_CSD_INT_REQ()

void ENIP_PDP_START_CSD_INT_REQ ( int bearer)

ENIP handler of the CSD (PPP dial-up) start request: set up the "PPP CSD" module.

Parameters
bearermeaning not known (selects one of two interface types)

◆ enip_sock_create()

int enip_sock_create ( int family,
int type,
int protocol,
int * socket_id,
uint32_t param,
const ENIP_SOCKET_DESTINATION * destination )

Create an ENIP socket.

Parameters
family1: IPv4
type0: datagram, 1: stream
protocol0, 17 (UDP) or 6 (TCP)
[out]socket_idreceives the socket ID, must not be NULL
parampassed to enip_sockh_create_internal; meaning not known
destinationsocket destination
Returns
0 or an ENIP error code (0x20xx)

◆ enip_socket_connect()

int enip_socket_connect ( int socket,
int address,
int unknown,
uint16_t port,
uint32_t timeout )

Connect a socket: set the peer of a datagram socket or start a TCP connection.

Parameters
socketsocket ID
addresspeer IPv4 address, network byte order
unknownmeaning not known
portpeer port, network byte order
timeoutTCP connect timeout
Returns
0 or an ENIP error code (0x20xx)

◆ enip_sockh_IF_init()

void enip_sockh_IF_init ( ENIP_IPH_INTERFACE * iface)

Pick a pseudo-random first local port for an interface.

Parameters
ifaceIP interface

◆ enip_sockh_create_internal()

ENIP_SOCKET * enip_sockh_create_internal ( int family,
int type,
int protocol,
int * socket_id,
uint32_t param1,
uint32_t param2 )

Allocate and initialise a socket in a free slot of the socket table.

Parameters
family1: IPv4
type0: datagram, 1: stream
protocol17 (UDP) or 6 (TCP)
[out]socket_idreceives the socket ID
param1meaning not known
param2meaning not known
Returns
socket, NULL when the table is full

◆ enip_sockh_autobind_IF()

int enip_sockh_autobind_IF ( ENIP_SOCKET * socket,
int address )

Bind a socket to an IP interface: the one matching its LMAN destination, or the first usable one.

Parameters
socketENIP socket
addresspeer IPv4 address, 0 or -1 for none
Returns
0 or an ENIP error code (0x20xx)

◆ enip_sockh_packet_allocate()

int enip_sockh_packet_allocate ( ENIP_SOCKET * socket,
uint32_t size,
uint32_t pool,
ENIP_PKT ** packet,
int timeout )

Allocate an outgoing packet for a socket with room for the interface headers.

Parameters
socketENIP socket bound to an interface
sizepayload size in bytes
poolbuffer pool (see ENIP_PacketAlloc)
packetreceives the ENIP packet
timeoutmeaning not known
Returns
0 or an ENIP error code (0x20xx)

◆ enip_sockh_dgram_connect()

int enip_sockh_dgram_connect ( ENIP_SOCKET * socket,
int address,
uint32_t unused,
uint16_t port )

Set the peer of a datagram socket.

Parameters
socketENIP socket
addresspeer IPv4 address, network byte order
unusednot read by the function
portpeer port, network byte order
Returns
0

◆ enip_sockh_prepare_send()

int enip_sockh_prepare_send ( int index,
ENIP_SOCKET * socket,
uint32_t address )

Fill the IPv4 header of an outgoing packet from the socket's settings.

Parameters
indexindex of the outgoing packet in the firmware's table
socketENIP socket
addressdestination IPv4 address, network byte order
Returns
0 or an ENIP error code (0x20xx)

◆ enip_tcph_sock_init()

int enip_tcph_sock_init ( ENIP_SOCKET * socket)

Initialise the TCP state of a socket: initial sequence number, windows and MSS.

Parameters
socketENIP socket bound to an interface
Returns
0

◆ enip_tcph_sock_connect()

int enip_tcph_sock_connect ( ENIP_SOCKET * socket,
int address,
uint32_t unknown,
uint16_t port,
uint32_t timeout )

Start a TCP connection: send SYN and start the connect timer.

Parameters
socketENIP socket
addresspeer IPv4 address, network byte order
unknownmeaning not known
portpeer port, network byte order
timeoutconnect timeout, 0 for the default
Returns
0 or an ENIP error code (0x20xx)

◆ enip_tcph_send_segment()

int enip_tcph_send_segment ( ENIP_SOCKET * socket,
uint32_t flags,
const void * data,
uint32_t size,
ENIP_PKT * packet,
int unknown )

Build and send one TCP segment.

Parameters
socketENIP socket
flagsTCP flags (2: SYN)
datapayload or NULL
sizepayload size in bytes
packetpreallocated ENIP packet or NULL
unknownmeaning not known
Returns
0 or an ENIP error code (0x20xx)

◆ enip_tcph_write_segment()

void enip_tcph_write_segment ( ENIP_SOCKET * socket,
ENIP_PKT * packet,
int use_sequence )

Fill in the TCP header of an outgoing segment of the socket and send it.

Only partly reversed.

Parameters
socketENIP socket
packetENIP packet with the IPv4 and TCP headers
use_sequencenonzero: keep the sequence number of the segment (retransmission), 0: take it from the socket

◆ enip_tcph_change_sock_state()

void enip_tcph_change_sock_state ( ENIP_SOCKET * socket,
uint32_t state )

Change the TCP state of a socket and notify its owner.

Parameters
socketENIP socket
statenew state in firmware numbering (0: closed, 8: SYN sent, 10: established)

◆ enip_tcph_frame_read()

void enip_tcph_frame_read ( ENIP_IPH_INTERFACE * iface,
ENIP_PKT * packet )

Process a received TCP segment.

Parameters
ifacereceiving IP interface
packetENIP packet

◆ enip_tcph_run()

void enip_tcph_run ( void )

Check the TCP timers of all sockets: retransmit, time out or move on in the close states.

◆ enip_tcph_get_SACK_option_from_list()

uint32_t enip_tcph_get_SACK_option_from_list ( ENIP_SOCKET * socket,
uint32_t count,
uint8_t * option )

Write a TCP SACK option (NOP, NOP, SACK) from the socket's SACK blocks.

Parameters
socketENIP socket
countmaximum number of blocks
optionoutput buffer
Returns
option size in bytes, 0 when there are no blocks

◆ enip_tcph_update_SACK_block_list()

void enip_tcph_update_SACK_block_list ( ENIP_SOCKET * socket)

Remove the SACK blocks that are already acknowledged.

Parameters
socketENIP socket

◆ enip_timer_init()

void enip_timer_init ( ENIP_TIMER * timer,
ENIP_MODULE * module )

Initialise an ENIP timer.

Parameters
timertimer
moduleENIP module whose timer list it will use

◆ enip_timer_cancel()

void enip_timer_cancel ( ENIP_TIMER * timer)

Stop an ENIP timer if it is running.

Parameters
timertimer

◆ enip_timer_start()

void enip_timer_start ( ENIP_TIMER * timer,
uint32_t timeout )

Start or restart an ENIP timer and schedule its module.

Parameters
timertimer
timeouttimeout

◆ LMAN_LINK_UP_CNF()

void LMAN_LINK_UP_CNF ( void )

LMAN handler of the link-up confirmation: mark the waiting connection as up and notify the owner.

◆ LMAN_FreeSocketReg()

void LMAN_FreeSocketReg ( unsigned index)

Free an LMAN socket registration (see RamSocketRegs).

Parameters
indexregistration index

◆ LMAN_FindContext()

uint16_t LMAN_FindContext ( uint16_t bearer,
uint16_t iface )

Find the LMAN context with the given bearer ID and interface.

Parameters
bearerbearer ID (see LMAN_AllocContext)
ifaceinterface index (see LMAN_AttachInterface)
Returns
context index 0..7, 0xFFFF when not found

◆ LMAN_GetBearerIdForCi()

uint8_t LMAN_GetBearerIdForCi ( uint16_t cid)

Get the bearer ID of an LMAN context.

Parameters
cidcontext index 0..7
Returns
bearer ID, 0xFF for an invalid context (also raises a firmware assertion)

◆ LMAN_GetSocketDestination()

int LMAN_GetSocketDestination ( uint16_t cepid,
LMAN_SOCKET_DESTINATION * destination )

Get where sockets of a process go: application flags, selector, bearer ID and interface index.

Parameters
cepidprocess ID
destinationreceives the destination
Returns
1 OK, 0 when the process has no LMAN socket registration (see RamSocketRegs)

◆ zDLL_Init()

void zDLL_Init ( ENIP_ZDLL_HEAD * list)

Initialise an empty ENIP double-linked list (two pointers: first, last).

Parameters
listlist head

◆ RamActiveGPRSProfileName()

const char * RamActiveGPRSProfileName ( void )

Get name of the current internet profile.

Returns
C-string
Available on platforms:
NSG, ELKA

◆ RefreshGPRSTraffic()

void RefreshGPRSTraffic ( )

Refresh the GPRS traffic counter.

◆ ResetGPRSTraffic()

void ResetGPRSTraffic ( void )

Reset the GPRS traffic counter.

◆ GetGPRSTrafficPointer()

int * GetGPRSTrafficPointer ( )

Get traffic used by GPRS.

Returns
pointer to the byte count
int bytes = *GetGPRSTrafficPointer();
int * GetGPRSTrafficPointer()
Get traffic used by GPRS.

◆ LMAN_GetOrAllocSocketRegIndex()

unsigned LMAN_GetOrAllocSocketRegIndex ( unsigned cepid)

Find the LMAN socket registration (see RamSocketRegs) of a process or take a free one.

Parameters
cepidCEPID of the process
Returns
registration index 0..13, 0xFFFF when the table is full (also raises a firmware assertion)

◆ LMAN_SetSocketReg()

int LMAN_SetSocketReg ( unsigned index,
const REGSOCKCEPID_DATA * reg,
int keep )

Set the data of an LMAN socket registration, as RegisterCepidForSocketWork does for the current process.

Parameters
indexregistration index 0..13 (see LMAN_GetOrAllocSocketRegIndex); larger values raise a firmware assertion
regregistration data, the first field must be below 800
keepnonzero: keep the registration when the process releases its last context; 0 leaves this flag unchanged
Returns
1 OK, 0 error