NetApp_SetSockAddr

Setup a socket address from an IPv4 or an IPv6 address.

Files

net_app.h/net_app.c

Prototype

          void  NetApp_SetSockAdd(NET_SOCK_ADDR         *p_sock_addr,
	                              NET_SOCK_ADDR_FAMILY   addr_family,
							      NET_PORT_NBR           port_nbr,
                                  CPU_INT08U            *p_addr,
								  NET_IP_ADDR_LEN        addr_len,
                                  NET_ERR               *p_err);

Arguments

p_sock_addr

Pointer to the socket address structure that will received the new socket address created (see section Network Sockets Concepts).

addr_family

Family address type :

NET_SOCK_ADDR_FAMILY_IP_V4
NET_SOCK_ADDR_FAMILY_IP_V6

port_nbr

Port number to associated with the new socket address.

p_addr

Pointer to IP address (IPv4 or IPv6) to associated with the new socket address.

addr_len

Length of the IP address :

NET_IPv4_ADDR_SIZE
NET_IPv6_ADDR_SIZE

p_err

Pointer to variable that will receive the error code from this function:

NET_APP_ERR_NONE
NET_ERR_FAULT_NULL_PTR
NET_APP_ERR_INVALID_ADDR_LEN
NET_APP_ERR_INVALID_ADDR_FAMILY

Returned Value

None.

Required Configuration

None.

Notes / Warnings

Some socket arguments and/or operations are validated only if validation code is enabled (see section Argument Check Configuration).