This library contains functions for TCP, UDP and Multicast sockets, as well as network configuration. The functions in this library are safe to be called from multiple processes at the same time, with the exception of the function ping. Both the traditional Berkeley style socket API and the synchronized socket functions are supported (the Berkeley style API is supported through macros implemented by the synchronized functions).
It is recommended that new applications use the Berkeley style API for portability.
Note that in order to run at 100 Mbs, the DS80C400 must be running at least 25MHz. This can be accomplished on the TINIm400 module by enabling the clock doubler.
For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
| struct | sockaddr |
| struct | in_addr |
| struct | in6_addr |
| struct | sockaddr_in |
| struct | pingdata |
Defines | |
| #define | ROM400_SOCK_VERSION 12 |
| #define | ROM400_SOCK_SYNCH_VERSION ROM400_SOCK_VERSION |
| #define | SOCKET_TYPE_DATAGRAM 0 |
| #define | SOCKET_TYPE_STREAM 1 |
| #define | SOCK_DGRAM SOCKET_TYPE_DATAGRAM |
| #define | SOCK_STREAM SOCKET_TYPE_STREAM |
| #define | PF_INET 4 |
| #define | AF_INET 4 |
| #define | AF_INET6 6 |
| #define | IPPROTO_UDP 0 |
| #define | TCP_NODELAY 0 |
| #define | SO_LINGER 1 |
| #define | SO_TIMEOUT 2 |
| #define | SO_BINDADDR 3 |
| #define | ETH_STATUS_LINK 1 |
| #define | htons(x) (x) |
| Convert a number to network byte order. | |
| #define | ntohs(x) (x) |
| Convert a number to host byte order. | |
| #define | socket(domain, type, protocol) syn_socket((type)) |
| Create a network socket for TCP or UDP communication. | |
| #define | sendto(socket_num, buffer, length, flags, address, address_length) syn_sendto(syn_setDatagramAddress((socket_num),1,(address)),(length),(buffer)) |
| Sends a UDP datagram to a specified address. | |
| #define | recvfrom(socket_num, buffer, length, flags, address, address_length) syn_recvfrom(syn_setDatagramAddress((socket_num),0,(address)),(length),(buffer)) |
| Receive a UDP datagram. | |
| #define | connect(socket_num, address, address_length) syn_connect((socket_num),(address)) |
| Connects a TCP socket to a specified address. | |
| #define | bind(socket_num, address, address_length) syn_bind((socket_num),(address)) |
| Binds a socket to a specified address. | |
| #define | syn_listen(socket_num, backlog) listen((socket_num),(backlog)) |
| Tells a socket to listen for incoming connections. | |
| #define | accept(socket_num, address, address_length) syn_accept((socket_num),(address)) |
| Accepts TCP connections on the specified socket. | |
| #define | recv(socket_num, buffer, length, flags) syn_recv((socket_num),(length),(buffer)) |
| Reads data from a TCP socket. | |
| #define | send(socket_num, buffer, length, flags) syn_send((socket_num),(length),(buffer)) |
| Sends data to a TCP socket. | |
| #define | getsockopt(socket_num, level, name, buffer, length) syn_getsockopt((socket_num),(name),(buffer)) |
| Get various socket options. | |
| #define | setsockopt(socket_num, level, name, buffer, length) syn_setsockopt((socket_num),(name),(buffer)) |
| Set various socket options. | |
| #define | getsockname(socket_num, address, address_length) syn_getsockname((socket_num),(address)) |
| Gets the local IP and port of a socket. | |
| #define | getpeername(socket_num, address, address_length) syn_getpeername((socket_num),(address)) |
| Gets the remote address of a connection-based (TCP socket). | |
| #define | syn_cleanup(process_id) cleanup((process_id)) |
| Close all sockets and free the parameter buffer associated with a task. | |
| #define | syn_avail(socket_num) avail((socket_num)) |
| Reports number of bytes available on a TCP socket. | |
| #define | join(socket_num, address, address_length) syn_join((socket_num),(address)) |
| Adds a socket to a specified multicast group. | |
| #define | leave(socket_num, address, address_length) syn_leave((socket_num),(address)) |
| Removes a socket from the specified multicast group. | |
| #define | syn_getnetworkparams(param_buffer) getnetworkparams((param_buffer)) |
| Get the IPv4 configuration parameters. | |
| #define | syn_setnetworkparams(param_buffer) setnetworkparams((param_buffer)) |
| Set the IPv4 configuration parameters. | |
| #define | syn_getipv6params(param_buffer) getipv6params((param_buffer)) |
| Get the IPv6 address. | |
| #define | syn_getethernetstatus() getethernetstatus() |
| Get the ethernet status. | |
| #define | gettftpserver(address, address_length) syn_gettftpserver((address)) |
| Get the address of the TFTP server. | |
| #define | settftpserver(address, address_length) syn_settftpserver((address)) |
| Set the address of the TFTP server. | |
| #define | syn_version() sock_version() |
| Returns the version number of this socket library. | |
| #define | arp_generaterequest(address, address_length) syn_arp_generaterequest((address)) |
| Unconditionally generate an ARP request for a given IPv4 address. | |
| #define | arp_cacherequest(address, address_length) syn_arp_cacherequest((address)) |
| Generate an ARP request for a given IPv4 address and add to the ARP cache. | |
| #define | syn_closesocket(socket_num) closesocket((socket_num)) |
| Closes a specific socket. | |
| #define | syn_getmacid() getmacid() |
| Get the pointer to the MAC ID storage area. | |
| #define | syn_setmacid() setmacid() |
| Stores the MAC ID into the MAC ID storage area. | |
Functions | |
| char * | inet_ntop (int family, void *addr, char *strptr, size_t len) |
| Converts a numeric address to a string. | |
| unsigned int | inet_pton (int family, char *str, void *addr) |
| Converts a string to a numeric IP address. | |
| unsigned long | inet_addr (char *inet_string) |
| Converts a string representing an IPv4 address to numeric form. | |
| int | syn_socket (unsigned int type) |
| Create a network socket for TCP or UDP communication. | |
| int | syn_setDatagramAddress (int socket_num, unsigned char sending, struct sockaddr *addr) |
| Set the IP address parameter for future datagram calls. | |
| int | syn_sendto (int socket_num, unsigned int length, void *buffer) |
| Sends a UDP datagram to an address earlier specified by a call to syn_setDatagramAddress. | |
| int | syn_recvfrom (int socket_num, unsigned int length, void *buffer) |
| Receive a UDP datagram. | |
| int | syn_connect (int socket_num, struct sockaddr *address) |
| Connects a TCP socket to a specified address. | |
| int | syn_bind (int socket_num, struct sockaddr *address) |
| Binds a socket to a specified address. | |
| int | listen (int socket_num, unsigned int backlog) |
| Tells a socket to listen for incoming connections. | |
| int | syn_accept (int socket_num, struct sockaddr *address) |
| Accepts TCP connections on the specified socket. | |
| int | syn_recv (int socket_num, unsigned int length, void *buffer) |
| Reads data from a TCP socket. | |
| int | syn_send (int socket_num, unsigned int length, void *buffer) |
| Sends data to a TCP socket. | |
| int | syn_getsockopt (int socket_num, unsigned int name, void *buffer) |
| Get various socket options. | |
| int | syn_setsockopt (int socket_num, unsigned int name, void *buffer) |
| Set various socket options. | |
| int | syn_getsockname (int socket_num, struct sockaddr *address) |
| Gets the local IP and port of a socket. | |
| int | syn_getpeername (int socket_num, struct sockaddr *address) |
| Gets the remote address of a connection-based (TCP socket). | |
| int | cleanup (unsigned int process_id) |
| Close all sockets and free the parameter buffer associated with a task. | |
| int | avail (int socket_num) |
| Reports number of bytes available on a TCP socket. | |
| int | syn_join (int socket_num, struct sockaddr *address) |
| Adds a socket to a specified multicast group. | |
| int | syn_leave (int socket_num, struct sockaddr *address) |
| Removes a socket from the specified multicast group. | |
| int | getnetworkparams (void *param_buffer) |
| Get the IPv4 configuration parameters. | |
| int | setnetworkparams (void *param_buffer) |
| Set the IPv4 configuration parameters. | |
| int | getipv6params (void *param_buffer) |
| Get the IPv6 address. | |
| unsigned int | getethernetstatus (void) |
| Get the ethernet status. | |
| int | syn_gettftpserver (struct sockaddr *address) |
| Get the address of the TFTP server. | |
| int | syn_settftpserver (struct sockaddr *address) |
| Set the address of the TFTP server. | |
| void | clear_param_buffers (void) |
| Clears the parameter buffers used by the socket library. | |
| unsigned int | sock_version (void) |
| Returns the version number of this socket library. | |
| int | syn_arp_generaterequest (struct sockaddr *address) |
| Generate an ARP request for a given IPv4 address. | |
| int | syn_arp_cacherequest (struct sockaddr *address) |
| Generate an ARP request for a given IPv4 address and add to the ARP cache. | |
| int | acceptqueue (int socket_handle, struct sockaddr *address) |
| Returns the number of sockets in the wait queue for this listening socket. | |
| int | udpavailable (int socket_handle, struct sockaddr *address) |
| Returns whether or not data is available to be read on a datagram socket. | |
| int | closesocket (int socket_num) |
| Closes a specific socket. | |
| unsigned char * | getmacid (void) |
| Get the pointer to the MAC ID storage area. | |
| void | setmacid (void) |
| Stores the MAC ID into the MAC ID storage area. | |
| long | ping (struct sockaddr *address, unsigned int address_length, unsigned int time_to_live, struct pingdata *response) |
| Pings the specified address. | |
| unsigned int | eth_readmii (unsigned int phy, unsigned int reg) |
| Read a PHY register via MII. | |
| void | eth_writemii (unsigned int phy, unsigned int reg, unsigned int val) |
| Write a PHY register via MII. | |
| void | eth_disablemulticastreceiver (void) |
| Disable multicast hardware receiver. | |
| int | unbind (int socket_num) |
| Unbind a bound socket. | |
| int | setsockowner (int socket_num, unsigned int process_id) |
| Sets the socket's owner to a different task ID. | |
| unsigned long | eth_readcsr (unsigned int reg) |
| Read a MAC CSR register. | |
| void | eth_writecsr (unsigned int reg, unsigned long val) |
| Write a MAC CSR register. | |
|
|
Accepts TCP connections on the specified socket. Accepts a TCP conection on the specified socket. This function moves the first pending connection request from the listen queue into the established state, assigning a new local socket to the connection for communication. accept blocks if there are no pending incoming requests. The socket socket_num must have been created with type SOCKET_TYPE_STREAM, bound to an address using bind, and given a listen queue by calling listen.
|
|
|
IPv4 family define, ignored by DS80C400 Silicon Software, but included for compatibility |
|
|
IPv6 family define, ignored by DS80C400 Silicon Software, but included for compatibility |
|
|
Generate an ARP request for a given IPv4 address and add to the ARP cache. If the given IP address is not in the ARP cache, generate an ARP request and add it to the cache.
|
|
|
Unconditionally generate an ARP request for a given IPv4 address. Unconditionally generate an ARP request for a given IPv4 address. This functionality can be used to implement Zeroconf protocols.
|
|
|
Binds a socket to a specified address. Assigns a local address and port (stored in the address parameter) to a socket. Binding a socket is necessary for server sockets. For client sockets, use bind if a specific source port is desirable. Fill address with 0's (for sin_addr and sin_port) to bind to any available local port. Use getsockname to discover which port the socket was bound to. NOTE: When binding a UDP socket, matching inbound UDP packets will be queued up for the socket. Call recvfrom periodically to avoid the risk of running out of kernel memory.
|
|
|
Connects a TCP socket to a specified address. Connects to a specified address with a streaming socket. This function can only be used once with each socket. The socket socket_num must have been created with type SOCKET_TYPE_STREAM.
|
|
|
Flag for analyzing ethernet status.
|
|
|
Gets the remote address of a connection-based (TCP socket). Stores the IP address of the remote socket communicating with the socket specified by socket_num. Use getsockname to get the local port's information.
|
|
|
Gets the local IP and port of a socket. Stores the local IP and port number of the specified socket in the the address parameter. Use getpeername to get the remote port's information for a connection-based (TCP) socket.
|
|
|
Get various socket options. Reads a number of supported socket options. Data written into the buffer depends on the requested socket option.
|
|
|
Get the address of the TFTP server. Returns the address of the server accessed by the TFTP functions. To communicate with a TFTP server, use the functions listed in rom400_tftp.h, the TFTP library.
|
|
|
Convert a number to network byte order. Converts a word from host byte order to network byte order. On the DS80C400, the orders are the same, so this function does not alter the input data. This function is included for compatibility.
|
|
|
Protocol ID define, ignored by DS80C400 Silicon Software, but included for compatibility |
|
|
Adds a socket to a specified multicast group. Adds a UDP socket to a specified multicast group. In order to receive multicasts from a group, first bind the socket to the port number that the multicast group is using (it is not sufficient to include it here in order to receive). Use the leave function to leave a multicast group.
|
|
|
Removes a socket from the specified multicast group. Removes a UDP socket from the specified multicast group.
|
|
|
Convert a number to host byte order. Converts a word from network byte order to host byte order. On the DS80C400, the orders are the same, so this function does not alter the input data. This function is included for compatibility.
|
|
|
IPv4 protocol family define |
|
|
Reads data from a TCP socket. Reads data from a TCP socket. If there is no data available, recv blocks until there is data, subject to the value of SO_TIMEOUT. NOTE: This function reads up to length bytes. Call this function repeatedly if you need to read a minimum number of bytes.
|
|
|
Receive a UDP datagram. Receives a message on the specified socket, and stores the address that sent it. If no data is available, recvfrom blocks subject to the SO_TIMEOUT value. The socket socket_num must have been created with a type SOCKET_TYPE_DATAGRAM. It is required to use bind to assign a local port to the socket, before receiving data. NOTE: This function reads up to length bytes of a datagram. Any data not read in the datagram will be discarded.
|
|
|
Version number associated with this header file. Should be the same as the version number returned by the sock_version function.
|
|
|
Version number associated with this header file. Should be the same as the version number returned by the sock_version function.
|
|
|
Sends data to a TCP socket. Writes data to a TCP socket. The return value of this function is only a local success/failure code, and may not necessarily detect transmission errors.
|
|
|
Sends a UDP datagram to a specified address. Sends a UDP datagram to a specified address. The success/failure code this function returns says nothing of if the packet was recieved by the target, only that the socket layer was able to push the data out. The socket socket_num must have been created with a type SOCKET_TYPE_DATAGRAM.
|
|
|
Set various socket options. Sets a number of supported socket options. Input data in the buffer depends on the desired socket option.
|
|
|
Set the address of the TFTP server. Set the address of the server that the TFTP functions will use. The settftpserver function must be used if the address of the TFTP server is not acquired by DHCP or 1-Wire. Once the TFTP server's address is set, use the functions listed in rom400_tftp.h to begin receiving files.
|
|
|
Argument for socket option. Local binding address.
|
|
|
Argument for socket option. Ignored by DS80C400 ROM.
|
|
|
Argument for socket option. Socket inactivity timeout.
|
|
|
Argument to function socket to create a UDP socket (same as SOCKET_TYPE_DATAGRAM)
|
|
|
Argument to function socket to create a TCP socket (same as SOCKET_TYPE_STREAM)
|
|
|
Create a network socket for TCP or UDP communication. Creates a socket for network communication. This function returns a socket handle, but has not specific local address assigned to it. Note that this function calls task_gettaskid through the function redirect table.
|
|
|
Argument to function socket to create a UDP socket (same as SOCK_DGRAM)
|
|
|
Argument to function socket to create a TCP socket (same as SOCK_STREAM)
|
|
|
Reports number of bytes available on a TCP socket. Reports the number of bytes available on a TCP socket. This is the number of bytes that can currently be read using the recv function without blocking.
|
|
|
Close all sockets and free the parameter buffer associated with a task. Close all sockets associated with a process ID and free the parameter buffer. User applications should call this function whenever a task dies or is killed to ensure all associated resources are freed by the socket layer.
|
|
|
Closes a specific socket. Closes the specified socket that was created using the socket function.
|
|
|
Get the ethernet status. Returns the ethernet status byte. This is a bit-wise OR of the following flags:
Currently, no other flags are defined.
|
|
|
Get the IPv6 address. Gets the IPv6 address of the ethernet interface. The format for the buffer after this function returns is:
|
|
|
Get the pointer to the MAC ID storage area. Returns the pointer to the MAC ID storage area. This area will store the MAC ID after a successful call to setmacid.
|
|
|
Get the IPv4 configuration parameters. Get the IPv4 configuration parameters, including IP address, subnet mask, and gateway. The parameters are returned in a buffer in the following form:
IPv6 addresses are autoconfigured. To retrieve the IPv6 address, use the getipv6params function.
|
|
|
Tells a socket to listen for incoming connections. Tells the socket to listen for connections. A queue of length backlog is created for pending (un-accepted connections). It is required to use bind to assign a local port before calling listen. Use accept to move an incoming request to an established state, or wait for incoming connections.
|
|
|
Stores the MAC ID into the MAC ID storage area. This is a redirected function. The DS80C400's default implementation of this function searches the 1-Wire for a DS2502U-E48 1-Wire chip which contains a MAC ID. This MAC ID is then stored into the MAC ID storage area, the location of which is stored in a pointer in the export table. Use the getmacid function to return a pointer to the MAC ID storage area.
|
|
|
Set the IPv4 configuration parameters. Set the IPv4 configuration parameters, including IP address, subnet mask, and gateway. Input parameters should be formatted in the following form:
Use this method to give the DS80C400 a static IP address. To dynamically configure an IP address, use methods from the DHCP library in rom400_dhcp.h (IP addresses leased by the DHCP client can still be retrieved by calling getnetworkparams). IPv6 addresses are autoconfigured. To retrieve the IPv6 address, use the getipv6params function.
|
|
|
Returns the version number of this socket library.
|
|
|
Argument for socket option. Enables/disables Nagle algorithm.
|
|
||||||||||||
|
Returns the number of sockets in the wait queue for this listening socket. Returns the number of sockets in the queue attempting to connect to this server socket.
|
|
|
Reports number of bytes available on a TCP socket. Reports the number of bytes available on a TCP socket. This is the number of bytes that can currently be read using the recv function without blocking.
|
|
|
Close all sockets and free the parameter buffer associated with a task. Close all sockets associated with a process ID and free the parameter buffer. User applications should call this function whenever a task dies or is killed to ensure all associated resources are freed by the socket layer.
|
|
|
Clears the parameter buffers used by the socket library. Clears buffers used to store parameters for the socket library. This function should be called immediately after calling the init_rom function, and before any socket library functions are called.
|
|
|
Closes a specific socket. Closes the specified socket that was created using the socket function.
|
|
|
Disable multicast hardware receiver. This function disables the "pass multicast" (PM) bit in the DS80C400 MAC control register. This improves performance if the application doesn't use multicast. This function must be called after initialization of the Ethernet. WARNING: IPv6 requires multicast. Disabling the receiver disables IPv6 address resolution. |
|
|
Read a MAC CSR register. This function reads a MAC CSR register from the DS80C400. See the data sheet and user's guide for more information about the CSR registers.
|
|
||||||||||||
|
Read a PHY register via MII. This function reads a PHY register via the MII interface. See the IEEE 802.3 specification (22.2.4) for a description of the MII management register set.
|
|
||||||||||||
|
Write a MAC CSR register. This function writes a MAC CSR register. See the DS80C400 data sheet and user's guide for more information about the CSR registers.
|
|
||||||||||||||||
|
Write a PHY register via MII. This function writes a PHY register via the MII interface. See the IEEE 802.3 specification (22.2.4) for a description of the MII management register set.
|
|
|
Get the ethernet status. Returns the ethernet status byte. This is a bit-wise OR of the following flags:
Currently, no other flags are defined.
|
|
|
Get the IPv6 address. Gets the IPv6 address of the ethernet interface. The format for the buffer after this function returns is:
|
|
|
Get the pointer to the MAC ID storage area. Returns the pointer to the MAC ID storage area. This area will store the MAC ID after a successful call to setmacid.
|
|
|
Get the IPv4 configuration parameters. Get the IPv4 configuration parameters, including IP address, subnet mask, and gateway. The parameters are returned in a buffer in the following form:
IPv6 addresses are autoconfigured. To retrieve the IPv6 address, use the getipv6params function.
|
|
|
Converts a string representing an IPv4 address to numeric form. Converts the input string into an IPv4 address suitable for setting in a sockaddr_in structure.
|
|
||||||||||||||||||||
|
Converts a numeric address to a string. Converts a numeric IP address to a presentable format as a null terminated string. IPv4 addresses are formatted such as in "192.0.1.1". IPv6 addresses are formatted such as in "b803:8a11:0000:2121:fec5:0601:aa01:0102". Note that the '::' shortcut is not supported--a '0000' must be fully specified.
|
|
||||||||||||||||
|
Converts a string to a numeric IP address. Converts a string represenation of an IP address into numeric format. IPv4 addresses are expected to be input in a format such as in "192.0.1.1". IPv6 addresses are expected to be formatted such as in "b8:03:8a:11:00:00:21:21:fe:c5:06:01:aa:01:01:02".
|
|
||||||||||||
|
Tells a socket to listen for incoming connections. Tells the socket to listen for connections. A queue of length backlog is created for pending (un-accepted connections). It is required to use bind to assign a local port before calling listen. Use accept to move an incoming request to an established state, or wait for incoming connections.
|
|
||||||||||||||||||||
|
Pings the specified address. Sends an ICMP echo request (ping) to a specified address. Note that this function is NOT safe to be called from multiple processes at the same time.
|
|
|
Stores the MAC ID into the MAC ID storage area. This is a redirected function. The DS80C400's default implementation of this function searches the 1-Wire for a DS2502U-E48 1-Wire chip which contains a MAC ID. This MAC ID is then stored into the MAC ID storage area, the location of which is stored in a pointer in the export table. Use the getmacid function to return a pointer to the MAC ID storage area.
|
|
|
Set the IPv4 configuration parameters. Set the IPv4 configuration parameters, including IP address, subnet mask, and gateway. Input parameters should be formatted in the following form:
Use this method to give the DS80C400 a static IP address. To dynamically configure an IP address, use methods from the DHCP library in rom400_dhcp.h (IP addresses leased by the DHCP client can still be retrieved by calling getnetworkparams). IPv6 addresses are autoconfigured. To retrieve the IPv6 address, use the getipv6params function.
|
|
||||||||||||
|
Sets the socket's owner to a different task ID. Sets the socket owner to a different task ID. This is useful where program code relies on cleanup to deallocate a process' resources, or in cases where ownership of a socket needs to be moved to a child process. Note that the new process ID is not checked for validity and it is possible to assign a socket to a non-existent task.
|
|
|
Returns the version number of this socket library.
|
|
||||||||||||
|
Accepts TCP connections on the specified socket. Accepts a TCP conection on the specified socket. This function moves the first pending connection request from the listen queue into the established state, assigning a new local socket to the connection for communication. accept blocks if there are no pending incoming requests. The socket socket_num must have been created with type SOCKET_TYPE_STREAM, bound to an address using bind, and given a listen queue by calling listen.
|
|
|
Generate an ARP request for a given IPv4 address and add to the ARP cache. If the given IP address is not in the ARP cache, generate an ARP request and add it to the cache.
|
|
|
Generate an ARP request for a given IPv4 address. Unconditionally generate an ARP request for a given IPv4 address. This functionality can be used to implement Zeroconf protocols.
|
|
||||||||||||
|
Binds a socket to a specified address. Assigns a local address and port (stored in the address parameter) to a socket. Binding a socket is necessary for server sockets. For client sockets, use bind if a specific source port is desirable. Fill address with 0's (for sin_addr and sin_port) to bind to any available local port. Use getsockname to discover which port the socket was bound to. NOTE: When binding a UDP socket, matching inbound UDP packets will be queued up for the socket. Call recvfrom periodically to avoid the risk of running out of kernel memory.
|
|
||||||||||||
|
Connects a TCP socket to a specified address. Connects to a specified address with a streaming socket. This function can only be used once with each socket. The socket socket_num must have been created with type SOCKET_TYPE_STREAM.
|
|
||||||||||||
|
Gets the remote address of a connection-based (TCP socket). Stores the IP address of the remote socket communicating with the socket specified by socket_num. Use getsockname to get the local port's information.
|
|
||||||||||||
|
Gets the local IP and port of a socket. Stores the local IP and port number of the specified socket in the the address parameter. Use getpeername to get the remote port's information for a connection-based (TCP) socket.
|
|
||||||||||||||||
|
Get various socket options. Reads a number of supported socket options. Data written into the buffer depends on the requested socket option.
This function assumes there is enough room in buffer to store the requested data.
|
|
|
Get the address of the TFTP server. Returns the address of the server accessed by the TFTP functions. To communicate with a TFTP server, use the functions listed in rom400_tftp.h, the TFTP library.
|
|
||||||||||||
|
Adds a socket to a specified multicast group. Adds a UDP socket to a specified multicast group. In order to receive multicasts from a group, first bind the socket to the port number that the multicast group is using (it is not sufficient to include it here in order to receive). Use the leave function to leave a multicast group.
|
|
||||||||||||
|
Removes a socket from the specified multicast group. Removes a UDP socket from the specified multicast group.
|
|
||||||||||||||||
|
Reads data from a TCP socket. Reads data from a TCP socket. If there is no data available, recv blocks until there is data, subject to the value of SO_TIMEOUT. NOTE: This function reads up to length bytes. Call this function repeatedly if you need to read a minimum number of bytes.
|
|
||||||||||||||||
|
Receive a UDP datagram. Receives a message on the specified socket, and stores the address that sent it in the address structure set by an earlier call to syn_setDatagramAddress. If no data is available, syn_recvfrom blocks subject to the SO_TIMEOUT value. The socket socket_num must have been created with a type SOCKET_TYPE_DATAGRAM. It is required to use syn_bind to assign a local port to the socket, before receiving data. NOTE: This function reads up to length bytes of a datagram. Any data not read in the datagram will be discarded.
|
|
||||||||||||||||
|
Sends data to a TCP socket. Writes data to a TCP socket. The return value of this function is only a local success/failure code, and may not necessarily detect transmission errors.
|
|
||||||||||||||||
|
Sends a UDP datagram to an address earlier specified by a call to syn_setDatagramAddress. Sends a UDP datagram to an address earlier specified by a call to syn_setDatagramAddress. The success/failure code this function returns says nothing of if the packet was recieved by the target, only that the socket layer was able to push the data out. The socket socket_num must have been created with a type SOCKET_TYPE_DATAGRAM.
|
|
||||||||||||||||
|
Set the IP address parameter for future datagram calls. In order to keep the functions in this library multi-process-safe, datagram functions syn_sendto and syn_recvfrom cannot have as many parameters as their traditional counterparts. This function sets the pointer to the address structure that will be used as the address parameter for functions syn_sendto and syn_recvfrom. Note that the Berkeley style API is now supported and is multi-process safe, so user software should never have to call this function.
|
|
||||||||||||||||
|
Set various socket options. Sets a number of supported socket options. Input data in the buffer depends on the desired socket option.
|
|
|
Set the address of the TFTP server. Set the address of the server that the TFTP functions will use. The settftpserver function must be used if the address of the TFTP server is not acquired by DHCP or 1-Wire. Once the TFTP server's address is set, use the functions listed in rom400_tftp.h to begin receiving files.
|
|
|
Create a network socket for TCP or UDP communication. Creates a socket for network communication. This function returns a socket handle, but has not specific local address assigned to it. Note that this function calls task_gettaskid through the function redirect table.
|
|
||||||||||||
|
Returns whether or not data is available to be read on a datagram socket. Returns 1 if there is data available to be read on a UDP socket.
|
|
|
Unbind a bound socket. Removes a local address and port from a socket that was assigned to it using bind.
|
| Copyright 2005 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |