34 #ifndef MAX_ADDR_STRING_LEN 35 #define MAX_ADDR_STRING_LEN 255 39 #define SOCK_SETSIZE 64 43 #define SOCK_CLR(sock, set) STB_NWSockClear((sock), (set)); 46 #define SOCK_SET(sock, set) STB_NWSockSet((sock), (set)); 49 #define SOCK_ZERO(set) STB_NWSockZero((set)) 52 #define SOCK_ISSET(sock, set) STB_NWSockIsSet((sock), (set)) 54 #ifndef INVALID_SOCKET 55 #define INVALID_SOCKET 0 98 typedef void (*NW_eth_callback)(E_NW_INTERFACE iface, E_NW_LINK_STATUS iface_status);
99 typedef void *NW_handle;
105 void *sock_array[SOCK_SETSIZE];
112 E_NW_PROTOCOL protocol;
113 BOOLEAN is_multicast;
190 void*
STB_NWOpenSocket(E_NW_AF af, E_NW_TYPE type, E_NW_PROTOCOL protocol, BOOLEAN nonblock);
206 BOOLEAN
STB_NWBind(
void *socket, U8BIT *address, U32BIT port);
259 E_NW_ERROR
STB_NWConnect(
void *socket, U8BIT *address, U32BIT port);
277 void*
STB_NWAccept(
void *socket, U8BIT *address, U32BIT *port);
288 S32BIT
STB_NWSend(
void *socket, U8BIT *buf, U32BIT num_bytes);
299 S32BIT
STB_NWReceive(
void *socket, U8BIT *buf, U32BIT max_bytes);
312 S32BIT
STB_NWReceiveFrom(
void *socket, U8BIT *buf, U32BIT max_bytes, U8BIT *address, U32BIT *port);
324 S32BIT
STB_NWSendTo(
void *socket, U8BIT *buf, U32BIT num_bytes,
325 U8BIT *address, U32BIT port);
BOOLEAN STB_NWCloseSocket(void *socket)
Closes (destroys) a socket instance.
U16BIT STB_NWLookupAddress(U8BIT *name, S_NW_ADDR_INFO **nw_addrs)
Performs a lookup to find the IP address(es) of the given host name.
NW_handle STB_NWStartEthernetMonitor(NW_eth_callback func)
Start monitoring the ethernet status.
BOOLEAN STB_NWDropMembership(void *socket, U8BIT *group_address)
Sets the ip option IP_DROP_MEMBERSHIP.
void * STB_NWOpenSocket(E_NW_AF af, E_NW_TYPE type, E_NW_PROTOCOL protocol, BOOLEAN nonblock)
Opens (creates) a new socket for subsequent use.
BOOLEAN STB_NWGetSocketName(void *socket, E_NW_AF *af, U8BIT *address, U32BIT *port)
Gets the socket's "name" (family, address and port)
BOOLEAN STB_NWSelectInterface(E_NW_INTERFACE iface)
Sets the network interface that will be used for all network or IP operations.
S32BIT STB_NWReceiveFrom(void *socket, U8BIT *buf, U32BIT max_bytes, U8BIT *address, U32BIT *port)
Receives a datagram and returns the data and its source address.
void STB_NWFreeWirelessAccessPoints(S_NW_ACCESS_POINT *access_points, U16BIT num_aps)
Frees the array of access points returned by STB_NWGetWirelessAccessPoints.
E_NW_ERROR STB_NWConnect(void *socket, U8BIT *address, U32BIT port)
Connects the socket to a remote host.
E_NW_LINK_STATUS STB_NWGetLinkStatus(void)
Get the selected interface link status.
void * STB_NWAccept(void *socket, U8BIT *address, U32BIT *port)
Accepts an incoming connection attempt on a socket.
BOOLEAN STB_NWSockIsSet(void *socket, S_NW_SOCKSET *socks)
Returns whether a specified socket is a member of a specified set.
U16BIT STB_NWGetWirelessAccessPoints(S_NW_ACCESS_POINT **access_points)
Scans and returns all access points visible on the wireless network.
E_NW_INTERFACE STB_NWGetSelectedInterface(void)
Returns the selected interface.
Definition: stbhwnet.h:117
BOOLEAN STB_NWAddMembership(void *socket, U8BIT *group_address)
Sets the ip option IP_ADD_MEMBERSHIP.
BOOLEAN STB_NWGetReuseaddr(void *socket, BOOLEAN *state)
Gets the socket option SO_REUSEADDR.
void STB_NWSockClear(void *socket, S_NW_SOCKSET *socks)
Clears the specified socket from the specified set.
void STB_NWStopEthernetMonitor(NW_handle hdl)
Stop monitoring the ethernet status.
BOOLEAN STB_NWSetReuseaddr(void *socket, BOOLEAN state)
Sets the socket option SO_REUSEADDR.
S32BIT STB_NWSelect(S_NW_SOCKSET *read_sockets, S_NW_SOCKSET *write_sockets, S_NW_SOCKSET *except_sockets, S32BIT timeout_ms)
Determines the status of one or more sockets, blocking if necessary.
BOOLEAN STB_NWInitialise(void)
Initialises the socket API, must be called once before using API.
BOOLEAN STB_NWGetMACAddress(E_NW_INTERFACE iface, U8BIT *mac_addr)
Gets the MAC address of the default ethernet connection.
S32BIT STB_NWReceive(void *socket, U8BIT *buf, U32BIT max_bytes)
Receives data from a connected socket.
System Wide Global Technical Data Type Definitions.
S32BIT STB_NWSend(void *socket, U8BIT *buf, U32BIT num_bytes)
Sends data on a connected socket.
S32BIT STB_NWSendTo(void *socket, U8BIT *buf, U32BIT num_bytes, U8BIT *address, U32BIT port)
Sends data to a specific destination.
Definition: stbhwnet.h:102
void STB_NWSockSet(void *socket, S_NW_SOCKSET *socks)
Sets a specificed socket in a specified set.
void STB_NWSockZero(S_NW_SOCKSET *socks)
Clears the socket set.
Definition: stbhwnet.h:108
BOOLEAN STB_NWListen(void *socket, S32BIT backlog)
Put socket into state of waiting for incoming connection.
BOOLEAN STB_NWConnectToAccessPoint(U8BIT *essid, U8BIT *password)
Attempts to connect to the wireless network with the given SSID. If the network is open then 'passwor...
BOOLEAN STB_NWBind(void *socket, U8BIT *address, U32BIT port)
Binds (names) a socket in the local address space.