Solvline Eddy DKV2.1.0.3 User Manual

Page 88

Advertising
background image

Chapter 6. Library

Introduction

88

struct in_addr addr;
addr.s_addr = SB_GetIp ();
printf ("IP Address : %s ", inet_ntoa(addr));

SB_GetMask

Function

Reads subnet mask address assigned to Eddy.

Format

Unsigned int SB_GetMack (char *interface);

Parameter

Interface

Interface name to be read
‚eth0‛ for WAN port.
‚eth1‛ for LAN port.

Returns

Unsigned int

Returns mask address in unsigned int type

Notice

Please see SB_GetIp also

SB_GetGateway

Function

Reads gate address assigned to Eddy.

Format

Unsigned int SB_SetGeteway(void);

Parameter

None

Returns

Unsinged int

Returns gate address in unsigned int type

Notice

Please see SB_GetIp also

SB_ConnectTcp

Function

Make connection to the server specified as TCP socket.

Format

Int SB_ConnectTcp (char *IP_Address, int Socket_No, int Wait_Sec,
int Tx_Size, int Rx_Size);

Parameter

IP_Address

IP address to connect in string type

Socket_No
Wait_Sec
Tx_Size
Rx_Size

Socket number of the server to connect
Wait time for connection (in seconds)
Tx buffer size of the socket (in K bytes)
Rx buffer size of the socket (in K bytes)

Returns

-1 ~ N

Handle number of the connected socket
-1: Connection failure
N: Handle number to the connected socket

Notice

If the connection is not made, the function t will try to re-connect for
time specified in wait_sec and return.
Tx,Rx_Size are size of the socket buffer size. These can be set from 1 to
64.
If it is set to number smaller than 1, size will 4kbytes as default; number
larger than 64 will set size of the buffer to 64kbytes as default.

Advertising