net.h File Reference

TCP/IP protocol library. More...

#include <stdlib.h>
#include <stdint.h>

Data Structures

struct  adapter_t
 
struct  in_struct
 Incoming protocol information. More...
 
struct  out_struct
 Outgoing protocol information. More...
 
struct  SOCKET
 Unique description of a bidirectional network communication channel. More...
 
struct  addr_type
 Hardware MAC / IP address pair description. More...
 
struct  arp_list_type
 Hardware address cache description. More...
 
struct  direntry_type
 Embedded File System directory. More...
 
struct  user_type
 User authentication and directory specification. More...
 

Macros

#define NULL   ((void *)_MAKE_32(0))
 
#define null   ((void *)_MAKE_32(0))
 
#define true   TRUE
 
#define false   FALSE
 
#define UDP_MAX_PACKET_SIZE   1472L
 
#define TCP_MAX_PACKET_SIZE   1460L
 
#define IS_LINKLOCAL(a)   ((a & 0xffff0000) == 0xfea90000 )
 
#define _FSYS_DEF
 
#define MAX_USER   10
 
#define MAX_DIR   200
 
#define MAX_NAME_LEN   60
 
#define MAX_USERNAME_LEN   30
 
#define MAX_PASS_LEN   30
 
#define EFS_TERMINATION   (_MAKE_32(0))
 
#define tpOutputFunc   tpOutputFunc
 
Adapter

adapter_t is a user-defined global structure for required network parameter such as IP address, MAC address, gateway etc.

#define adapter_t
 
Adapter type

Adapter type parameter for add_adapter()

#define ETH8900   1 /* CS8900 */
 
#define ETH91C111   2 /* SMSC91C111 */
 
#define ETHEMAC   3 /* DM642,DM648,L137,C6657 */
 
#define ETHAX88783   4 /* AX88783 */
 
#define ETHDM9010B   5 /* DM9010B */
 
#define ETHKSZ8851   6 /* KSZ8851 */
 
#define ETHDM9016   7 /* DM9016 */
 
Operation Mode

Operation mode parameter for d91c111_ext_init() or DM2_EmacInit()

#define FULL_DUPLEX   0x01
 
#define HALF_DUPLEX   0x00
 
#define SPEED_10   0x00
 
#define SPEED_100   0x04
 
#define AUTO_NEG   0x08
 
#define SPEED_1000   0x20
 
#define FDX_100   (FULL_DUPLEX | SPEED_100 )
 
#define FDX_10   (FULL_DUPLEX | SPEED_10 )
 
#define HDX_100   (HALF_DUPLEX | SPEED_100 )
 
#define HDX_10   (HALF_DUPLEX | SPEED_10 )
 
#define FDX_1000   (FULL_DUPLEX | SPEED_1000)
 
#define FIBER_MODE   0x10
 
Service Mode

Service mode parameter for net_init()

#define DHCP_ENABLE
 
#define DNS_ENABLE
 
Socket Error Codes

Socket Error Codes, read with socket_struct ->error_code

See also
socket_struct
#define SO_NO_ERROR   0x00000000 /* no error */
 
#define SO_TRANSMIT_ERROR   0x00000001 /* Transmit error */
 
#define SO_NO_ARP_ADDRESS   0x00000002 /* Unresolved destination MAC */
 
#define SO_TIMED_OUT   0x00000003 /* transfer function timed out */
 
#define SO_IN_USE   0x00000004 /* TCP only: not ready */
 
#define SO_NOT_ESTABLISHED   0x00000005 /* TCP only: not connected */
 
#define SO_CONNECTION_RESET   0x00000006 /* TCP only: connection reset by remote host */
 
#define SO_WRONG_CHECKSUM   0x00000007 /* net_recv():: data checksum failed */
 
#define SO_BUFFER_TOO_SMALL   0x00000008 /* net_recv():: data > maxdatalen received */
 
#define SO_NO_INPUT_BUFFER   0x00000009 /* net_recv():: NULL pointer given as data buffer */
 
#define SO_NOT_OPEN   0x0000000a /* Socket is not open */
 
#define SO_CONNECTION_CLOSED   0x0000000c /* TCP only: connection closed */
 
#define SO_WINDOW_ERR   0x0000000d /* TCP only: window size zero received */
 
#define SO_CONNECTION_ESTABLISHED   0x0000000e /* TCP only: connected */
 
#define SO_MMU_ERROR   0x0000000f /* SMCS91c111: MMU error */
 
#define SO_SEND_PENDING   0x00000010 /* Send pending */
 
#define SO_NO_LINK   0x00000011 /* No valid link */
 
#define SO_DNS_ERR   0x00000012 /* Name resolution missing or pending */
 
#define SO_NO_TCP_MEM   0x00000013 /* TCP out of memory */
 
#define SO_ERROR_MASK   0x7fffffff /* socket error mask */
 
Socket data and protocol types

Use with socket_open()

#define DATATYPE_CHAR   0x1
 
#define DATATYPE_SHORT   0x2
 
#define DATATYPE_INT   0x4
 
#define IPT_TCP
 
#define IPT_UDP
 
#define TCP_INIT_FUNC
 
#define UDP_INIT_FUNC
 
#define ICMP_INIT_FUNC
 
Well known addresses
#define ANY_ADDRESS   "0.0.0.0" /* Any IP address */
 
#define BROADCAST   "255.255.255.255" /* Broadcast IP address */
 
Well known ports
#define ANY_PORT   0
 
#define ECHO_PORT   0x07
 
#define TIME_SERVER_PORT   0x0D
 
#define FTP_DATA_PORT   0x14
 
#define FTP_CONTROL_PORT   0x15
 
#define TELNET_PORT   0x17
 
#define DNS_SERVER_PORT   0x35
 
#define DHCP_SERVER_PORT   0x43
 
#define DHCP_CLIENT_PORT   0x44
 
#define TFTP_SERVER_PORT   0x45
 
Socket Configuration Failure

socket_open() return value in case of insufficient memory or illegal configuration parameters

#define INVALID_SOCKET   NULL
 
Socket Option
#define SO_UDP_NO_CHECKSUM   0x00000004 /* UDP w/o checksum */
 
#define SO_TCP_STATE_CLOSED   0x00000008 /* use TCP state closed */
 
#define SO_TCP_NO_RETRANS   0x00000020 /* disable TCP retransmit */
 
#define SO_TCP_NO_FAST_RETRANS   0x00000040 /* disable fast TCP retransmit */
 
#define SO_USE_PROXY   0x00000200 /* use proxy server */
 
Socket Failure

Socket Error, net_recv() and net_send() return code

#define SOCKET_ERROR   (_MAKE_32(-1))
 
Socket callback function return parameter
#define SOCKET_CB_OK   (_MAKE_32(1))
 
#define SOCKET_CB_CLOSED   (_MAKE_32(-1))
 
net_send() return value
#define NET_SEND_PENDING   (0L) /* net_send() pending, check error code */
 
#define NET_SEND_SUCCESS   (1L) /* net_send() success */
 
#define NET_SEND_ERROR   (-1L) /* net_send() fatal error */
 
net_recv() return value
#define NET_RECV_EVENT   (-1L) /* net_recv() event */
 
TCP state

use with tcp_get_state()

#define TCP_CLOSED   0
 
#define TCP_LISTEN   1
 
#define TCP_SYN_SENT   2
 
#define TCP_SYN_RECEIVED   3
 
#define TCP_ESTABLISHED   4
 
TCP options
#define TCP_UNA_SEG   1 /* TCP unacknowledged segment size */
 
#define TCP_RETRANS_DELAY   2 /* TCP retransmit delay time */
 
Multicast check

Macro for testing multicast messages

#define IS_MULTICAST(a)   ((a & 0x00f00000) == 0x00e00000 )
 
Access Permission
#define FTP_READ   1
 
#define FTP_CREATE   2
 
#define FTP_WRITE   4
 
#define FTP_RW   (FTP_READ | FTP_WRITE)
 
#define FTP_RAM   8
 
#define FTP_FAT   16
 
#define HTTP_GZIP   512
 
Flags

Use with fsys_send_all()

#define FSYS_SEND_ALL   0x00000010
 
#define FSYS_WRITE_BOOT_SECTOR   0x00000020
 
#define FSYS_ERASE_SECTOR   0x00000040
 
Return codes

Use with fsys_send_all()

#define FSYS_BIOS_PROTECT_ERROR   -1
 
#define FSYS_CHECKSUM_ERROR   -2
 
#define FSYS_INTEL_HEX_ERROR   -3
 
#define FSYS_SECTOR_ERASE_ERROR   -4
 
#define FSYS_FLASH_PROGRAM_ERROR   -5
 
#define FSYS_BUFFER_UNDERRUN_ERROR   -6
 
#define FSYS_OUT_OF_MEMORY_ERROR   -7
 
#define FSYS_OUT_OF_RANGE_ERROR   -8
 

Typedefs

typedef int(* tpOutputFunc) (const char *format,...)
 

Functions

int32_t net_init (char *ip, char *subnet, char *gateway, uint32_t(*dhcp_func)(char *, uint16_t), char *dns, uint32_t(*dns_func)(void))
 Main network initialization function. More...
 
SOCKET * socket_open (char *dest_addr, uint16_t dest_port, uint16_t src_port, uint8_t data_type, int32_t(*init_func)(SOCKET *))
 Create a new socket. More...
 
int32_t socket_close (SOCKET *so)
 Close a socket and free all associated memory. More...
 
void socket_define_callback (SOCKET *so, int32_t(*call_back_function)(SOCKET *, void *, uint32_t, uint32_t), void *data, uint16_t maxdata)
 Install a user callback function for a specific socket. More...
 
void * socket_get_data_pointer (SOCKET *so)
 Retrieve a data pointer from socket. More...
 
uint32_t set_socket_option (SOCKET *so, uint32_t option)
 Modify socket options. More...
 
arp_list_typearp_check_ip_address (uint32_t ip, uint16_t dev_nr)
 Perform MAC address lookup in local ARP cache to find MAC address for specified IP address. More...
 
arp_list_typecheck_arp_address (SOCKET *so, uint32_t request_time)
 Perform address resolution. More...
 
void arp_clear_cache (void)
 Invalidate ARP cache. More...
 
void arp_set_timeout (uint32_t val)
 Set timebase for ARP cache. More...
 
void arp_invalid_ip_address (uint32_t ip)
 Invalidates specific IP address. More...
 
int16_t send_ip (SOCKET *so, addr_type *dest, uint16_t len, uint16_t id)
 Low-level send function for sending RAW IP packets. More...
 
int32_t net_send (SOCKET *so, void *data, uint16_t len)
 Send a message via the specified socket. More...
 
int32_t net_send_string (SOCKET *so, char *data)
 Send a zero terminated string via the specified socket. More...
 
int32_t net_send_ready (SOCKET *so, void *data, uint32_t len, uint32_t timeout)
 Send a message via the specified socket, wait until message is successfully transmitted or a timeout occurred. More...
 
int32_t net_recv (SOCKET *so, void *data, uint16_t maxdatasize)
 Receive data via the specified socket. More...
 
int32_t set_recv_buffer (SOCKET *so, void *data, uint16_t maxdatasize)
 Define a socket buffer. More...
 
int32_t net_recv_ready (SOCKET *so, void *data, int32_t *len, uint32_t timeout)
 Receive data via the specified socket, wait until message is successfully received and connection closed from sender or a timeout occurred. More...
 
void net_isq (void)
 The main polling function for processing sockets, must be periodically called in the main application. More...
 
SOCKET * install_icmp_socket (uint16_t size)
 Install an ICMP socket for ping and messages. More...
 
int32_t connect (SOCKET *so, void *data, uint32_t send_max, int32_t timeout)
 Actively establish a connection. More...
 
int32_t shutdown (SOCKET *so, int32_t timeout)
 Active shut-down of a TCP connection. More...
 
SOCKET * accept (SOCKET *so)
 Check TCP state; if connection established, the socket descriptor is returned else NULL. More...
 
int32_t tcp_listen (SOCKET *so)
 Switch socket to listening state. More...
 
uint16_t tcp_set_option (SOCKET *so, uint32_t option, uint32_t val)
 Set a TCP option. More...
 
int16_t tcp_get_state (SOCKET *so)
 Determine tcp state. More...
 
uint16_t tcp_tx_complete (SOCKET *so)
 Test if the last TCP transmission was acknowledged. More...
 
uint32_t tcp_pending_window (SOCKET *so)
 returns the number of unacknowledged bytes More...
 
uint16_t tcp_force_retransmit (SOCKET *so)
 force a retransmit More...
 
int16_t tcp_set_keep_alive_time (SOCKET *so, uint32_t time)
 Set keep alive time. More...
 
void tcp_send_zero_window (void *so)
 send a zero window packet More...
 
void tcp_send_window_update (void *so)
 update window size More...
 
uint32_t gethostbyname (char *hostname, int32_t *timeout)
 Get the ip address of clients specified by name. More...
 
uint32_t net_set_gateway (char *ip, char *sub_mask)
 Configure a gateway. More...
 
char * get_netlib_ver (char *buffer)
 Retrieve netlib revision string. More...
 
char * net_allocate_aligned_buffer (int32_t size)
 Allocate a data buffer, aligned to the processors cache line size. More...
 
addr_typeget_address_offset (uint16_t dev_nr)
 Get current offset of MAC + IP address structure. More...
 
uint32_t get_ip_address (uint16_t dev_nr)
 Get configured IP address. More...
 
uint32_t set_ip_address (uint16_t dev_nr, char *addr_str)
 Set IP address. More...
 
uint32_t get_mac_address (uint16_t dev_nr, uint16_t *dest)
 Get MAC address. More...
 
void net_print_stat (uint16_t dev_nr, tpOutputFunc pLog)
 Print statistic TCP stack information. More...
 
char * inet_ntoa (uint32_t i_addr, char *s)
 Convert IP-address from 0xbbaaddcc to "aaa.bbb.ccc.ddd". More...
 
uint32_t inet_aton (char *s)
 Converts zero terminated IP-address string from "aaa.bbb.ccc.ddd" to integer in network byte order. More...
 
static uint16_t htons (uint16_t val)
 Convert a short int from host to network byte order. More...
 
static uint16_t ntohs (uint16_t val)
 Convert a short int from network to host byte order. More...
 
static uint32_t htonl (uint32_t val)
 Convert a long int from host to network byte order. More...
 
static uint32_t ntohl (uint32_t val)
 Convert a long int from network to host byte order. More...
 
static uint32_t nstohl (uint16_t val1, uint16_t val2)
 Convert two network short int to long host int. More...
 
static uint32_t nstonl (uint16_t val1, uint16_t val2)
 Convert two network short int to long. More...
 
int32_t multicast_join_group (SOCKET *so, char *maddr, uint16_t mport)
 Join a multicast group. More...
 
int32_t multicast_leave_group (SOCKET *so, char *maddr, uint16_t mport)
 Leave a multicast group. More...
 
int32_t fsys_init_dir (user_type *user_list, mmc_function_type *mmc_func)
 Initialize all directories specified in user_list. More...
 
int32_t fsys_init_file (direntry_type *fp, uint32_t offset, int32_t size)
 This function initializes all necessary internal parameters for a specific user file. More...
 
int32_t fsys_get_file_size (direntry_type *fp)
 Determine file size of specified file. More...
 
direntry_typefsys_send_all (direntry_type *fp, int32_t size, int32_t send_all)
 File transmission function. More...
 
void fsys_init_flash (void)
 Initialize FLASH-sectors. More...
 
void * DM2_EmacInit (uint8_t mode, char *mac_addr_str, void(*link_status)(unsigned char))
 Initialize EMAC module. More...
 

Variables

uint32_t net_initialized
 
arp_list_typearp_head []
 
const char netlib_ver []
 

Detailed Description

                          _         _             _
                       __| |    ___(_) ____ _ __ | |_
                      / _` |   / __| |/ _` | '_ \| __|
                     | (_| | _ \__ \ | (_| | | | | |_
                      \__,_|(_) ___/_|\__, |_| |_|\__|
                     Signalprocessing |___/ Technology
Author
D.SignT GmbH & Co. KG
© 2001-2016
Claus Hermbusche
Version
2.91.3
Date
2019-05-22
Target Platform:
D.Module.8900, D.Module.91C111, D.Module2.DM642, D.Module2.C6747, D.Module2.C6657
Compiler:
CCS 3.3
Version History:
- 2.91.03 2019-05-22 CH
- embedded filesystem fsys: second level subdirectories not working
(images, css and js directory for HTTP server)
- HTTP server: http_send_websocket() with and without copy
- F2837x: websocket support
- F2837x: Modbus support
- tcp_send_window_update(): additional event status for callback
signalling
- F2837x HTTP server: webpages located in FLASH
- 2.91 2018-09-12 CH
- UniDAQ2 supported
- DSK6416: shorter DHCP request time
- embedded filesystem fsys: new function fsys_add_dir() to expand efs
- embedded filesystem fsys: HTTP page transmission from FLASH was
missing HTTP header
- embedded filesystem fsys: improved read function
- HTTP server: websocket support
- HTTP server: improved header creation
- HTTP server: header parsing case insensitive
- HTTP server: http_send_user_page() always returned 0
- HTTP server/embedded filesystem: file transfer too slow from
SPI-drive
- 2.90 2018-03-20 CH
- DHCP: re-transmit timeout too short
- New supported module: Unidaq2
- 2.89 2017-03-24 CH
- TCP net_recv()/receive callback returned received length 0 during
socket event SO_WINDOW_ERR
- Incoming IP Header Checksum RFC971, RFC1071 and RFC1624 tolerant
- Outgoing IP Header Checksum RFC1624 compliant
- DM648 and C6747: timeout for Intel Hex uploads too short
- FTP server: subdirectories on FAT file system were ignored in
absolute paths
- TCP: connect() increased local port regardless if it was a well
known port or not.
- FTP client: reasonable timeout and keep alive timer values if
running on SYS/BIOS.
- VC33/91c111: SMSC91c111 Configuration Register bit12 (no delay) set
- DHCP on C5x: transaction ID never changed
- D.Module2.C6657: 2-pair downshift feature supported. Auto-Negotiate
with another Gigabit link partner using cable pairs 1,2 and 3,6 to
downshift and link at 10 Mbps or 100 Mbps.
- KSZ8851: tx complete interrupt disabled to avoid endless loop
if interrupt was missed.
- 2.88 2016-09-06 CH
- DHCP client: unblocking in net_init(); consecutive net_isq() calls
required to obtain IP address.
- DHCP client: retrigger-able after link loss
- TCP: keep alive counter inactive; fixed
- DNS: DNS server address 0.0.0.0 could cause memory leak in case of
link local address assignment
- new: send packet to directed broadcast
- 2.87 2015-12-23 CH
- ARP table overflow due to incoming multicast packets from outside
of local subnet: fixed
- D.Module.C6657 supported
- EMAC: SO_SEND_PENDING error caused by concurrent net_send() calls
reset faster
- C674x OEM lib with EABI format available
- unused TCP code was not eliminated by linker due to remaining references
- EMAC: global array packet_buffer[] changed to label pbuffer_base and
pbuffer_end in linker command file. New define for packet buffer size
- 2.86 2015-01-15 CH
- new flag for gzip compressed HTTP contents
- DM9016: noise on the bus could cause wrong VLAN/BW control
settings of integrated switch device - fixed by switch reset
- 2.85 2014-10-09 CH
- data_type, data_shift and outgoing protocol information accessible
- TCP probe packets with different size caused a wrong buffer offset
calculation.
- IP: zero checksum caused dropped packets
- 2.84 2014-08-05 CH
- eZdsp5502: tx FIFO overrun caused by wrong type cast fixed
- F28xx: random MSB content of unmasked scratch register caused
wrong data content.
- 2.83 2014-02-20 CH
- SMSC91c111: if last ACK-FIN packet was lost, retransmitted packet
had wrong sequence number
- HTTP server: shorter delay for "GET" response
- TCP: last ACK after shutdown caused keep alive packet
- TCP: if incoming ACK-PUSH-FIN packet with data was retransmitted
due to packet loss, new data was not signalled to user
- TCP: CWR flag disabled on ACK-FIN packet. some stacks could delay
the last ACK-FIN packet when CWR flag was set
- ARP: gratuitous ARP delayed to overcome slow router link detect
- direntry_type: put_byte() parameter offset changed to unsigned
- direntry_type: new block read function read_block()
- FTP: long timeout when last data packet lacks FIN: fixed
- 2.82 2014-01-13 CH
- TCP: old TCP sequence with different data length was discarded
- all SMSC91c111 boards: missing auto-negotiation enable bit in
PHY control register caused link fail on certain switches even
when no auto-negotiation was requested.
- 2.81 2013-11-08 CH
- net_init(): new parameter for subnet mask and gateway
- F28335: wrong data size for DATATYPE_SHORT sockets
- 2.80 2013-10-24 CH
- eZdspF28335: timing issues
- eZdspF28335: wrong TCP checksum was caused by a wrong 16bit cast
operator
- TCP: additional RST packet for dangling connection
- 2.79 2013-09-18 CH
- TCP: retransmitted FIN flag could be counted twice
- TCP transmit: lost FIN, SYN and RST packets are now retransmitted
- TCP receive: lost FIN packet handled by sending additional
ACK or (ACK | FIN) packet
- FTP Server: fast retransmits disabled
- HTTP: fast retransmits disabled
- HTTP: early free of dynamic memory for finished connection to
save memory
- HTTP: new state machine for monitoring connections
- HTTP: timeouts for detecting dangling connection changed
- HTTP: new functions http_set_up_page() and http_send_page() for
delayed transmission
- 2.78 2013-06-28 CH
- TI compiler tools updated
- parameter types verified
- 2.77 2013-04-11 CH
- TCP: FIN-packet during delayed ACK could cause final data packet
lost. SOCKET structure member res_align2 used to store last packet
length
- FTP Client: data socket timeout increased when file transmission
complete was signalled on control socket to receive delayed packets.
- 2.76 2013-03-07 CH
- F28XX: wrong checksum generation for keep alive packets
- 2.75 2013-02-26 CH
- TCP: Error code SO_TIMED_OUT set when pending SO_WINDOW_ERR and
ARP cache clear occurred. ARP cache clear occurs only after no
packets were received for some time.
- socket_struct extended with member "proto" for used protocol
- error code SO_BUFFER_TOO_SMALL was not reset
- 2.74 2012-07-18 CH
- random start-up time from init to established link is used as seed
value for srand() function
- DHCP: received DHCP answer re-triggers DHCP request timeout
- DHCP: random delay between re-transmits
- DHCP/Auto-IP: failed DHCP request caused endless Auto-IP loop
- 2.73 2012-06-11 CH
- TCP connect caused ARP flood if destination was unreachable
- TCP connect(): parameter retry and timeout not working correctly
- check_arp_address(): freeing NULL pointer as ARP address caused
ARP cache overrun
- 2.72 2012-05-30 CH
- DHCP: multiple DNS IP addresses could cause endless loop;
- DHCP: invalid option field and data length in incoming DHCP message ignored;
- VC33+ADSP21065: net_recv() and callback function returned wrong data size for
DATATYPE_INT TCP sockets
- FTP server: adoption to new dFAT filesystem rev. 2.0; RAM-disc and
SD/MM-card > 2GB supported.
- DM2DM642: TCP retransmit time increased
- new Ethernet controller Davicom DM9016 supported
- DHCP: transaction ID now derived from MAC address
- DM9016+LXT971: MD interrupt assigned to GPIO19
- 2.68 2011-09-15 CH
- FSYS: missing end condition could cause endless loop.
- FSYS, HTTP, F28xx: missing header packet for Java source
- DHCP: several enhancements
- ARP: RARP requests disabled
- behaviour of gateway changed, level 2/3 router supported
- new socket option SO_USE_PROXY to access a router doing NAT
- ARP: if a destination was unreachable for hours, a new ARP request
could take a long time due to wrong backoff algorithm. fixed
- ARP: timed out addresses are deleted from ARP table, not only
invalidated
- 2.63 2011-05-12 CH
- Interrupt combiner activated for DM648
- new socket error SO_NO_TCP_MEM instead of endless loop in case of
out of sequence number error
- TCP option SACK could cause wrong MSS. fixed
- callback function call could cause data pointer NULL when send was
in progress. fixed.
- DNS databuffer never freed. fixed
- wrong subnet mask for auto-IP link-local address. fixed
- FTP server: sporadic hanging data transmission due to connection
status not reset. fixed
- 2.59 2010-12-23 CH
- connect() returned error without error code
- TCP: missing ACK for old packets
- SMSC91c111: wrong padding byte caused oversized packet
- SMSC91C111: error message SO_IN_USE wrongly set during TCP ACK
- TCP: unexpected packet flood stopped with zero window packet
- TCP: reassembling of missed packets after retransmit
- 2.57 2010-10-13 CH
- performance issues for giga bit
- HTTP: illegal pointer could cause malfunction
- TCP: ACK-FIN and RST could cause illegal socket pointer during
retransmit
- FSYS: ASCII and binary file upload revised and simplified
- SMSC91c111: new timeout and MMU reset during wait for allocation
interrupt
- HTTP: new webpage generator makewebpage generates an entire webpage
with subpages and subdirectories
- HTTP: changed limits: MAX_DIR = 200, MAX_NAME_LEN = 60
- ARP: wrong timeout could block ARP request
- DM648: shorter delay in TCP state TCP_STATE_WAIT
- DM648: wrong ALE clear bit definition caused random address filter
- 2.53 2010-05-06 CH
- TCP: non-volatile variable could cause a missing re-transmit
- SMC91c111: additional MMU reset after timeout in smc_write_packet_data()
- HTTP: transmitting a large page could cause connection timeout
- FTP client: double FTP_free_data call could cause DSP hang
- FSYS: Transmit error flag could terminate TCP connection
- HTTP: new socket ageing. Older sockets are closed and freed faster
- VC33: incoming MAC address word 0000 caused address FFFF.
- FSYS: file size algorithm improved
- FTP Server: data socket in passive mode with wrong port number
- TCP: Remote Window update could cause wrong input length
- SMSC91c111: link detection timeout increased
- VC33: optimizer caused wrong integer arithmetic
- 2.47 2010-02-10 CH
- SMSC91c111: reliability improvements
- TCP: remote window size estimated during receive faults
- DHCP: new Auto IP configuration, when DHCP server is not available
- Multicast: packets with a zero checksum were ignored when socket
option SO_UDP_NO_CHECKSUM was used
- pserver/TCP: new TCP state TIME_WAIT to prevent accidental
connection
- HTTP: TCP retransmits activated
- HTTP: insufficient HEAP could lead to dangling connection
- UDP broadcast caused checksum error
- EMAC: uninitialized variable could cause socket mismatch in seldom cases
- UDP: receiving and sending broadcast messages
- HTTP: improved transfers for elements located in RAM
- 2.39 2009-10-02 CH
- SMSC91c111: RX overrun with MMU reset instead of processing
receive
- SMSC91c111: Receiver and transmitter disabled during RX
overrun
- SMSC91c111: Re-allocate TX packet during RX overrun when
allocation is in progress
- SMSC91c111: wait for TX complete during RX overrun
- TCP: transmit of acknowledge could cause recursion during
receive
- SMSC91c111: TX FIFO empty flag in PTR register checked
instead of TX complete interrupt flag
- TCP: received packet during retransmit lost
- TCP: tcp_tx_complete() triggers retransmit if necessary
- 2.37 2009-09-11 CH
- TCP: ACK-FIN sometimes with wrong sequence number. fixed
- TCP: new transmit complete function tcp_tx_complete()
- netlib: internal string functions replaced by rts
- C6x: early keep alive packet after connect() could cause
confusion in certain clients
- SMC91C111: timeout for emergency reset too short
- new error code SO_DNS_ERR for pending DNS requests
- SMC91C111: temporary socket could cause receive problems
- F28xx: Write-Followed-by-Read Pipeline conflict fixed (SPRU067.pdf)
- TCP: ACK-FIN after retransmit with wrong sequence number
- 2.31 2009-08-11 CH
- TCP:missing delayed acknowledge could cause wrong receive window
- EVM6747 supported
- DM642: additional cache write back for 32bit wide SDRAM
- socket structure and multicast overlay structure concatenated
- UDP: new socket error SO_NO_ARP_ADDRESS for unresolved addresses
- Socket option SO_UDP_NO_CHECKSUM caused wrong checksum error
- dual Ethernet bug: net_send() blocked forever when link not
established
- dual Ethernet bug: net_isq() processed always three smsc91c111
- SMSC91c111 bug: rx overrun error not handled. fixed
- TCP: missing fast retransmit after rx overrun error
- TCP: new dynamic sequence number administration
- SMC91c111: old rx buffer re-use for transmit FIFO improved
chip internal memory allocation
- 2.22 2009-02-05 CH
- TCP: duplicate retransmit packet with wrong sequence number
- new meaning of net_send() return value
- TCP: improved TCP flow control, new internal timing
parameter for retransmit and timeout
- connect() with timeout value 0 returns immediately
- DHCP client: missing retransmit
- EMAC: missing isr loop could cause UDP checksum error
- single multicast address with different ports
- EVM6437 supported
- net_recv() extension for fragmented IP packets
- new keep alive timer for TCP
- C6x: uninitialized function pointer could cause DSP/BIOS reset
- second parameter of dhcp_func() changed to u_int16_t
- EMAC: missing cache write back caused problems when heap
was linked to external memory
- 2.15 2008-04-09 CH
- FTP server supports absolute paths
- FTP server supports passive transfer mode
- Fragmented UDP packet caused checksum error
- DSK5509, DSK5510: wrong byte ordering in FLASH write/read.
- DM642, DSK6455: erroneous link detect. fixed
- new socket option SO_TCP_ACK_KEEPALIVE: a TCP keep alive
packet is acknowledged
- DM642, DSK6455: TCP option length > 8 bytes ignored, new
- option length up to 24 bytes allowed.
- embedded filesystem: small ASCII files (<1460 bytes) in RAM
with wrong file length. fixed
- FTP server with new return structure for a detailed result
- FTP server command DELE for erasing a FLASH sector
- eZdsp TMS320F28335 supported
- incremental checksum update error (RFC1624)
- 2.11 2007-12-07 CH
- DSK6455 MEZZANINE supported with 1000 MBit full duplex mode
- F2812: Linear address space for file upload
- DSK91c111: external PHY Intel LXT971 with fiber support
- F2812: wrong data length in callback function for data type short
- F2812: wrong data length in net_send function for data type short
- DSK91c111: missing status word in transmit could lead to lost packets
- new HTTP authentication method.
- FTP server support for F2812
- TCP: low TCP data throughput after retransmit; fixed
- TCP: new TCP option TCP_UNA_SEG for setting the unacknowledged
segment size.
- DSK91c111: new initialization function dsk_init()
- DSK91c111: new link status callback function
- IP: wrong receive data size for DATATYPE_INT
- Embedded file system: a static local length information
caused an upload error 2 when a file was uploaded twice.
- Sockets: wrong internal buffer pointer during delayed
acknowledge could cause error2 error after hex file upload.
- 2.00 22 Feb 2007 CH
- FSYS: fsys_ascii_bin_upload() could block; fixed
- FSYS: wrong file buffer initialization could lead to free(NULL)
- New supported TI DSP's: F2812, DM642, C6455
- FTP server: wrong case for D.FAT and Flash File System
- 1.97 1 Feb 2007 CH
- TCP: wrong acknowledge sequence number when ACK | FIN is
received with data > 0
- FTP client: far section of FTPclient.lib could not be linked
into external memory
- missing 0xffff mask caused a non-working TCP in VDSP3.5
- TCP: ST_TCP_WIN_FLAG was not reset after window error clear
- net_send_ready(): new timeout calculation
- 1.96 29 May 2006 CH
- Packet driver: smc_release_packet could cause endless loop.
- FTP server: memory leak in PORT command
- TI C6x: some bugfixes for activated cache
- new error code in TCP: net_recv() returns -1 with error_code
SO_CONNECTION_ESTABLISHED when a new connection is established.
- Packet driver: packet header cached in socket structure
- TI C6x: Some structure alignments for cache line fitting
- DSK C6711, C6713 and C6416: no timer is used for initialization
- 1.95 14 Dec 2005 CH
- static TCP sequence numbers
- IP TOS field accessible
- static ARP table
- FTP Client: no 64K buffer limitation
- TCP: Uninitialized retransmit timer could cause unwanted
retransmits and sequence number mismatch. Fixed
- new FTP to FAT interface for D.FAT or external filesystem
- TCP: some improvements for stability
- Packet driver smsc91c111: wrong bank select could cause a
dead lock. fixed
- Wrong interrupt handling and a silicon bug on smsc19c111
could cause lost packets. fixed
- 1.9 14 Apr 2005 CH
- IP: on some IP packets the carry flag caused a checksum error on Sharc
- UDP: ignore checksum zero
- CCS 3.0 new structure alignment
- TCP-Sockets: wrong buffersize check caused a constant delay. fixed
- TCP: small buffer size lead to slow connection. fixed
- HTTP: java class names case insensitive. fixed
- Embedded file system: directory names case insensitive. fixed
- Wrong MAC address in ARP table on gateway multicast packets. fixed
- HTTP: interrupted transmission could lead to HTTP-404 not found error. fixed
- FSYS: fsys_init_file(): dynamic file buffer pointer could be
overwritten. Fixed
- TCP bug: Early ACK could cause recursion. Fixed
- New Library for FTP client support
- First level of Multicast Address support
- 1.8 21 Jun 2004 CH
- socket_define_callback() - new user callback function
definition for receiving packets.
- new memory management on 91C111.
- fsys_intelhex_download() wrong flash read function caused
malfunction on D.Module.C6713.
- malformed intel-hex download fixed.
- Intel-hex upload with zero delimited lines possible (
useful for some telnet connections).
- TCP bug: send_tcp_option():during window error no retransmit
possible
- TCP bug: internal destination window size was decreased on
retransmit
- WinXP TCP Transmission problems: new sequence number cache
architecture for retransmits
- 1.7 17 Dec 2004 CH
- TCP Bug: Wrong TCP Option in SYN Packets in sockets with
- New 10/100MBit Ethernet D.Module.91C111 adapted
- RARP- reverse ARP implemented
- When IP-address 0.0.0.0 configured, RARP request is sent and new
- IP-address is assigned on RARP-reply or valid ICMP-packet.
- Bug in net_send_ready(): Wrong data length for data type int
- new function get_ip_address(), set_ip_address()
- TCP bugfix: some TCP-packets caused a checksum error
- 1.6 3 Jun 2003 CH
- TCP state closed added. Use with new socket option
- SO_TCP_STATE_CLOSED and tcp_listen() function.
- TCP: Ack is sent immediately after receiving ( and not in
- Visual DSP++ 1.0 bug: arithmetic overflow interrupt
occurred on msb-test.
- TCP: maximum receive-packet-size increased from 536 to 1460 Bytes.
- TCP: wrong sequence number comparison on acknowledge-packet in
established mode.
- New Hardware DSK-91C111 adapted.
- Support for DSK C5510, C6711 and C6416
- 1.5 12 Nov 2002 CH
- HTTP Support for http.lib
- fsys.c - simple file support functions for d.modules
- pserver.c - parallel server support
- UDP bug fixed: checksum error for fragmented packets fixed
- TCP bug fixed: wrong TCP-checksum on delayed packets
- pragma CODE_SECTION .nettestfast and .nettestslow
- Gateway implemented
- net_recv_ready() bug: wrong length on connection closed
- TCP bug fixed: RST-flag in TCP_FIN_WAIT_1 & _2 not recognized
- ST_NEW_DATA_FLAG was not reset after connection close or reset
- TCP & UDP bug fixed: carry flag lost in 32 bit pseudo checksum
- 1.4 23 Mai 2002 CH:
- TCP bug: wrong socket option for MSS in SYN packet
(effect: a socket DATATYPE_INT could not be connected)
- SO_CONNECTION_RESET was not reported to user
- accept() implemented
- net_send_string() implemented
- net_send_ready(): no limitation of bytes to send
- FTP Support for ftp.lib
- 1.3 30 Apr 2002 CH:
- TCP: duplicate packet rejection
- complete DHCP sequence (DHCPDISCOVER - DHCPOFFER - DHCPREQUEST - DHCPACK ) implemented
- DMA transfer for TMS320 6x
- connect(): wrong max retry value
- TCP: FIN -flag sometimes not reset
- TCP: received ACK,PSH,FIN was not recognized in net_recv()
- TCP: senders window size was ignored; new error
message: SO_WINDOW_ERR.
- 1.2 23 Jan 2002 CH:
- DHCP: initialization bug fixed
- new blocking receive function: net_recv_ready()
- new timeouts and retransmit values for connect() and shutdown()
- 1.1 11 Dec 2001 CH:
- socket_open() changed:
- parameter protocol removed, init_func is
sufficient to determine protocol
- net_init() changed:
- if DHCP and DNS are both enabled
DNS Server IP may be set to NULL
to use the DHCP server machine for
name resolution
- net_init() waits for DHCP server response
- TCP: sequence number bug fixed
- 1.0 22 Oct 2001 by CH :
initial release

Macro Definition Documentation

#define NULL   ((void *)_MAKE_32(0))
#define null   ((void *)_MAKE_32(0))
#define true   TRUE
#define false   FALSE
#define tpOutputFunc   tpOutputFunc
Examples:
Blocksend.c, and BoardSpecific.c.

Typedef Documentation

typedef int(* tpOutputFunc) (const char *format,...)

Message log function. E.g. printf() or CPrintf() Use with net_print_stat()