Home

TCP/IP - Hilscher Knowledge Base

image

Contents

1. Hex Value Definition Description 0xC0080085 LR_E_TCP_ERR_MAX_GROUP_EXCEEDED_TCP_UDP_CMD_SET_SOCK_OPTION Command TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ ulMode TCP_SOCK_ADD_MEMBERSHIP The maximum number of IP multicast groups has exceeded Default configuration 64 0xC0080086 LR_E_TCP_ERR_DISCARD_KEPT_REQ_CMD A kept request command has discarded This confirmation has no further meaning for the application unless the application must give back this packet to their resource pool 0xC0080095 R_E_TCP_ERR_UNEXP_ANSWER An unexpected unknown confirmation command has received 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC00800C9 R_E_TCP_TASK_F_BUSY The task is busy intern 0xC0070100 R_E_IP_ERR_IP_ADDR_INVALID_IP_CMD_PING The IP address parameter ulIpAddr in command TCPIP_IP_CMD_PING_REQ is invalid This means the IP address ulIpAddr is equal to the TCP IP stacks own IP address 0xC0080101 TLR_E_TCP_ERR_IP_ADDR_INVALID_TCP_UDP_CMD_OPEN The IP address parameter ulIpAddr in command TCPIP_TCP_UDP_CMD_OPEN_REO is invalid The parameter ulIpAddr must be zero 0 0 0 0 or equal to
2. Hex Value Definition Description 0xC0080140 TLR_E_TCP_ERR_MAX_DATA_LEN_EXCEEDED_TCP_CMD_SEND The maximum TCP data count nin command TCPIP_TCP_CMD_SEND_REO has exceeded See parameter ulLen The maximum value for nis TCPIP_MAX_TCP_DATA_CNT 1460 0xC0080202 TLR_E_TCP_ERR_SOCKET_STATE_TCP_CMD_SEND The command TCPIP_TCP_CMD_SEND_REO cannot be executed because the socket is in an inappropriate state 0xC0080210 TLR_E_TCP_ERR_NO_FREE_QUEUE_ELEMENT_TCP_CMD_SEND The TCP send command TCPIP_TCP_CMD_SEND_REQ must be rejected because the list of free queue elements is empty Remark Per default configuration the initial size of this list is 128 Every send command TCPIP_TCP_CMD_SEND_REO or TCP IP_UDP_CMD_SEND_REQ occupy one queue element until the confirmation command is given back to the application To avoid this resource problem the application must reduce the count of open send jobs over all sockets 0xC0080315 LR_E_TCP_ERR_TIMEOUT_TCP_CMD_SEND The TCP Send timeout has expired by sending TCP data with command CPIP_TCP_CMD_SEND_REQ The remote host has not answered within the Send Timeout The TCP Send timeout is set in command TCPIP_TCP_CMD_WAIT_CONNECT_REO or TCPIP_TCP_CMD_CONNECT_REQ parameter ul Timeout Send Default 31 s Table 78 TCPIP_TCP_CMD_SEND_CNF Packet status error Note If the error
3. define TCP_RECV_OPT_BROADCAST 0x00000001 define TCP_RECV_OPT_MULTICAS 0x00000002 typedef struct TCPIP_DATA_TCP_UDP_CMD_RECEIVE_IND_Ttag LR_UINT32 ulTpaAddr THER NEBE SL VIZORE 9 RIS HEL 2 LILO EONS LR_UINT8 abData TCPIP_MAX_TCP_UDP_DATA_CNT N a2 Ie DA NED UID CMI RUBIN WAS END IS define TCPIP_DATA_TCP_UDP_CMD_RECEIVE_IND_SIZE SITZE ERDANTZEINCBEDBECNDERE CE IVEM ENDEN EI CPFPEMZISELSBRUDBEDZIFAEENT typedef struct TCPIP_PACKET_TCP_UDP_CMD_RECEIVE_IND_Ttag TLR_PACKET_HEADER_T tHead IMEI _IDVAI A _ ICP UDP_CMD_RECEIVE END T TCPIP_PACKET_TCP_UDP_CMD_RECEIVE_IND_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Da ta Hilscher 2005 2015 The application interface Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_RECEIVE_IND_T 113 134 Type Indication Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of AP task process queue ulSrc UINT32 Source queue handle of TCP_UDP task process queue ulDestld UINT32 0 2 1 Destination End Point Identifier specifying the final receiver of the packet within the Destinat
4. Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC0070087 R_E_IP_ERR_ARP_ENTRY_NOT_FOUND_IP_CMD_GET_PARAM The requested ARP information in command TCPIP_IP_CMD_GET_PARAM_REO could not be delivered The ARP entry was not found in ARP cache 0xC00800C8 TLR_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0070131 TLR_E_IP_ERR_MODE_UNKNOWN_IP_CMD_GET_PARAM The mode parameter ulMode in command TCPIP_IP_CMD_GET_PARAM_REDO is invalid Table 44 TCPIP_IP CMD_GET_PARAM_CNF Packet status error Source code example E CMIDI T ET_PARAM_CNF_T FAR EEE Dik ser ptPck UE IRV SONG ApIpCmdGetParamCnf TCPIP_AP_TASK_RSC_T TCP TE PACK TLR_RESULT Rey HET EET Sc if TLR_S_OK eRslt DER S Ca eo cr LIB_MEMCPY ullpAddr Bee gt ST amp pt amp pt sizeof ptPck gt tLoc abl TLR_POOL_PACKE return eRslt Ne TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public ples Head ulSta k gt tData unParam tArp EthernetAddr 0 tData unParam tArpEntry abEt tData unParam tArp ELEASE ptRsc gt tLoc hPool ptPck Entry ullp
5. CPIP CP_UDP_CMD_CLOSE Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC000001A R_E_REQUEST_RUNNING Request is already running 0xC0080079 TLR_E_TCP_ERR_CONN_RESET The connection has closed by reset Hard close 0xC00800C8 R CP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080122 R_E_TCP_ERR_TIMEOUT_INVALID_TCP_UDP_CMD_CLOSE_ALL The timeout parameter ulTimeout in command TCPIP_TCP_UDP_CMD_CLOSE_ALL_REO IS invalid 0xC0080302 TLR_E_TCP_ERR_DEST_UNREACHABLE_TCP_UDP_CMD_CLOSE_ALL Command TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ The destination host network or port is unreachable 0xC0080312 LR_E_TCP_ERR_TIMEOUT_TCP_UDP_CMD_CLOSE_ALL The TCP Close timeout has expired One or more connections to remote host s could not be closed gracefully within this time For this timeout see command ALL R EQ parameter ulTimeout Table 65 TCPIP_TCP_UDP_CMD_CLOSE_ALL_CNF Packet status error Note status field TLR_E_TCP_ expired Destination is unreachable and TLR_1 J ERR_TIM Error TER E TGP ERR_D EST_UNREACHABL TCP E_TCP_UDP_CMD_CLOSE_ALL The confirmation command returns the re
6. TCPIP_DATA_IP_CMD_SET_PARAM_REO Z define TCPIP_DATA_IP_CMD_SET_ PARAM REQ SIZE ADD ARB ENTRY sizeof TLR_UINT32 10 sizeof tAddDelArpEntry define TCPIP_DATA_IP_CMD_SET_ PARAM REQ SIZE DEL ARP ENTRY sizeof TLR_UINT32 10 sizeof tAddDelArpEntry define TCPIP_DATA_IP_CMD_SET_ PARAM REQ SIZE DEL ARP _ENTRY_IP N sizeof TLR_UINT32 A sizeof tDelArpEntryIp define TCPIP_DATA_IP_CMD_SET_PARAM_REO_SIZE_DEL_ARP_ENTRY_MAC sizeof TLR_UINT32 6 sizeof tDelArpEntryMac define TCPIP_DATA_IP_CMD_SET PARAM REQ SIZE _SEND_ARP_ REQ sizeof TLR_UINT32 10 sizeof tSendArpReqg Ne define TCPIP_DATA_IP_CMD_SET PARAM REQ SIZE SEND _ARP_T REQ N sizeof TLR_UINT32 14 sizeof tSendArpTmtReq define TCPIP_DATA_IP_CMD_SET_PARAM_REO_SIZE_SET_ARP_REO_TMT N sizeof TLR_UINT32 4 sizeof tSetArpReqTmt typedef struct TCPIP_PACKET_IP_CMD_SET_PARAM REQ Ttag TLR_PACKET_HEADER_T tHead TCPIP_DATA_IP_CMD_SET_ PARAM REQ T tData TCPIP_PACKET_IP_CMD SET PARAM REQ T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description Structure TCPIP_PACKET_IP_CMD_SET_PARAM_REQ_T Type Request 39 134 Variable Type Value Range Head Structure TLR_PACKET_HEADER_T Descr
7. De I TCP_UDP_CND_RECEI VE Request Command Figure 13 UDP communication example TCPIP_TCP_UDP_CMD_RECEIVE_IND Once the socket is opened all incoming UDP data for this socket will be sent to the application by means of TCPIP_TCP_UDP_CMD_RECEIVE commands TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 19 134 Eule UDP_CND_SEND Request Command Data Socket Her nn UDP_CND_SEND Confirmation Command Device Figure 14 UDP communication example TCPIP_UDP_CMD_SEND_REO CNF The application processes the data and sends its response data using TCPIP_UDP_CMD_S commands GI ND TCP_UDP_CND_CLOSE Request Command Socket i gt TCP_UDP_CMD_CLOSE Confirmation Command Device Figure 15 UDP communication example TCPIP_TCP_UDP_CMD_CLOSE_REQ CNF When the application wants to stop UDP communication it sends a TCPIP_TCP_UDP_CMD_CLOSE
8. OxCOO700FF R_E_IP_ERR_GENERIC Special internal error code returned by IpStart function 0xC0080003 R_E_TCP_ERR_CODEDIAG_FATAL A fatal error is occured Terminate the task 0xC0080005 R_E_TCP_TASK_F_INITIALIZATION_FAILED Failed to initialize the task Accept Init packets and Config packets only 0xC0080006 R_E_IP_ERR_INIT_INVALID_SERIAL_NUMBER Invalid serial number 0xC0080007 R_E_IP_ERR_INIT_IP_INIT_ERROR Failed to initialize the IP layer see task status 0xC0080009 R_E_TCPIP_TCP_TASK_PROCESS_CANCELED Cancel process is in progress command can not be executed 0xC008000A R_E_TCPIP_EDD_IDENTIFY_FAILED Failed to identify the EDD Ethernet Device Driver 0xC008000B R_E_TCPIP_APPLICATION_TIMER_CREATE_FAILED Failed to create an application timer Timer task 0xC008000C R_E_TCPIP_APPLICATION_TIMER_INIT_PACKET_FAILED Failed to initialize a packet of application timer Timer task 0xC008000D R_E_TCPIP_INVALID_STARTUP_PARAMETER_SOCKET_MAX_CNT Invalid Startup Parameter ulSocketMaxCnt 0xC008000E R_E_TCPIP_INVALID_STARTUP_PARAMETER_POOL_ELEM_CNT Invalid Startup Parameter ulPoolElemCnt 0xC008000F R_E_TCPIP_INVALID_STARTUP_PARAMETER_EDD_OUT_BUF_MAX_CNT Invalid Startup Parameter ulEddOutBufMaxCnt 0xC0080010 R_E_TCPIP_INVALID_STARTUP_PARAMETER_ARP_CACHE_SIZE Invalid Startup Parameter ulArpCacheSize 0xC0080011 R_E_TCPIP_INVALID_STARTUP_PARAMETE
9. TCP_CMD_SEND Request Command 5 Data v Acknowledge Socket ne gt TCP_CNMD_SEND Confirmation Command Device Figure 3 TCP client example TCPIP_TCP_CMD_SEND_REQ CNF Once the connection is established the application can then start sending its request data using a TCPIP_TCP_CMD_SEND request command The TCP IP stack forwards the data to the server and waits for the server s TCP IP stack to acknowledge it When the acknowledgement arrives the stack returns a TCPIP_TCP_CMD_SEND confirmation command to the application Remark The application must not wait for the TCPIP_TCP_CMD_SEND confirmation command to send the next TCPIP_TCP_CMD_SEND request command T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 14 134 5 Data v lt Acknowledge Socket De p TCP_UDP_CMD_RECEI VE Request Command H gt RIS TCP_UDP_CNMD_RECEI VE Request Command Device De gt TCP_UDP_CND_RECEI VE Request Command Figure 4 TCP client example TCPIP_TCP_UDP_CMD_RECEIVE_IND Wh
10. Valid modes of packet ulMode variable define IP_PRM ADD ARP ENTRY 1 define IP_PRM DEL ARP ENTRY 2 define IP_PRM DEL ARRE ENTRY LP 3 define IP_PRM DEL ARP ENTRY MAC 4 define IP_PRM_SEND_ARP_REQ 5 define IP_PRM_SEND_ARP_TMT_REQ 6 define IP_PRM SET ARP REQ TMT 7 define IP_PRM REGISTER _ACD_APP 8 define IP_PRM REGISTER_ICMP_APP 9 typedef struct TCPIP_DATA_IP_CMD_SET_PARAM REQ Ttag TLR_UINT32 ulMode union SERCE LR_UINT32 ullpAddr LR_UINT8 abEthernetAddr 6 tAddDelArpEntry TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 38 134 STIRE TLR_UINT32 ullIpAddr tDelArpEntryIp STRUGE TLR_UINT8 abEthernetAddr 6 tDelArpEntryMac SERCE TLR_UINT32 ulServices tRegisterIcmpService Ss anes LR_UINT32 ulIpAddr LR_UINT8 abEthernetAddr 6 tSendArpReq STEIGH LR_UINT32 ullIpAddr LR_UINT8 abEthernetAddr 6 PREUTNTS2EISTatlonenerbore se SAD OriEmCOmmancl mar mths mc OUMit or tSendArpTmtReq stations has reached e g 2 2 Sets TLR_UINT32 ulTimeout tSetArpReqTnt unParam
11. Mode ulMode Description union element of Datatype Value unParam TCP_SOCK_TTL Set TTL value for ulTtl UINT32 1 64 255 1 outgoing IP packets TCP_SOCK_SEND_TIMEOUT Set new send ulTimeoutSend UINT32 0 23141 2 timeout 0 defaults to milliseconds 31000 Applicable to TCP sockets only TCP_SOCK_INACTIVE_TIMEOUT Set inactivity ulTimeoutInactive UINT32 0 2 1 5 timeout 0 Timeout milliseconds inactive Applicable to TCP sockets only TCP_SOCK_KEEPALIVE_TIMEOUT Set keep alive ulTimeoutKeepAliv UINT32 0 2 1 6 timeout e 0 Keep alive milliseconds inactive Applicable to TCP sockets only TCP_SOCK_ADD_MEMBERSHIP Add IP multicast ulMulticastGroup UINT32 Multicast group 7 group membership address Applicable to UDP sockets only TCP_SOCK_DROP_MEMBERSHIP Drop IP multicast ulMulticastGroup UINT32 Multicast group 8 group membership address Applicable to UDP sockets only TCP_SOCK_MULTICAST_TTL Set TTL for ulMulticastTtl UINT32 1 255 9 multicast packets Applicable to UDP sockets only TCP_SOCK_MULTICAST_LOOP Set loopback mode ulMulticastLoop UINT32 0 1 10 of outgoing 0 Loopback multicast packets inactive Applicable to UDP sockets only TCP_SOCK_TOS Set TOS value Tor ulTos UINT32 0 255 See notes 11 outgoing TCP and below UDP packets TCP_SOCK_VLAN Enable 802 1Q tVlanTag Struct 12 VLAN tagging bEnable 0 1 Off On usId Vlan Id 0 OxF
12. 0xC0070039 R_E_IP_ERR_INIT_INVALID_GATEWAY The start parameters contains an invalid gateway IP address 0xC007003C R_E_IP_ERR_INIT_NO_IP_ADDR Failed to obtain an IP address from the specified source s 0xC007003D R_E_IP_ERR_INIT_DRIVER_FAILED The initialization of the driver layer EDD is failed 0xC007003E R_E_IP_ERR_INIT_NO_IP_ADDR_CFG There is no source for an IP address BOOTP DHCP IP address parameter specified 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 31 134 Hex Value Definition Description 0xC0070150 TLR_E_IP_ERR_INIT_INVALID_FLAGS_IP_CONFIG The start parameters configures an invalid flag combination for the manual IP configuration IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NET_MASK IP_CFG_FLAG_GATEWAY Valid flag combinations are No flag set No manual configuration only DHCP and or BOOTP IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NET_MASK Local network without gateway IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NET_MASK IP_CFG_FLAG_GATEWAY Network with gateway Table 11 TCPIP_IP_CMD_SET_CONFIG_CNF Packet status error Source code
13. define LOCAL PORT 1024 OC all Gly UDP ae orat TLR_RESULT ApTcpUdpCmdOpenReq TCPIP_AP_TASK_RSC_T FAR ptRsc WEP We _RYNCIKE I Cle UID CC MIDL OPIN IRC ae T if TLR_POOL_PACKET_GET ptRsc gt tLoc hPool amp ptPck return TLR_E_FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask 0 SEO UERBELINIKSESENWEDNERENIES Rep PekTEpEeRSCc IT T T ptPck gt tHead ulLen TCPIP DATA TCP UDP CMD OPEN REO STZE ptPck gt tHead ulld CREC E IGG WL Sinhreyo ely ptPck gt tHead ulSta Op ptPck gt tHead ulCmd TCPIP_TCP_UDP_CMD_OPEN_REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ullpAddr 0 fe O Ws address ptPck gt tData ulPort LOCAL_PORT fee 2 65534 is specified port if defined TCP_CLIENT defined CP_SERVER DEP ECKX SEDAEA WIP EOEOCOL WEP PINOUO_ Wel else PeBerR Se Dieicel wULeaojeocel WE PRO HG 14 HE ST endif if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask TLR_POOL_PACK return TL Re E return Packet structure eyo ele eE EREE ICR IP TET E12 UND IE MID Oje LR_UINT32 LR_UINT32 bi LR_UINT32 IGRI DATA HIRSS _ ON Pp PrPekr 100 SE ERI S IE ETES ERGE hol T BET Bind socket to PS WIG S_OK SR Ge 6 EN_CNEF_Ttag ullpAddr ulP ulP IWC REIER HIE ON 1 OLEJ HS ls EN_CNF_T define TCPIP_DA
14. iS_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask i SEO UBER HDH Hee ACK GimES RCC Oleh Ch EEE EIRE CINKS CER ptPck gt tHead ulLen TCPIP_DATA_IP_CMD_SET_PARAM_REO_SIZE_ADD_ARP_ENTRY ptPck gt tHead ulld Tae NSC eroermilisndlepNd ptPck gt tHead ulSta 0 ptPck gt tHead ulCmd TCPIP_ IP CMD SET_ PARAM REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ulMode IP_PRM_ADD_ARP_ENTRY ptPck gt tData unParam tAddDelArpEntry ullpAddr REMOTE_IP_ADDR MAC address of REMOTE_IP_ADDR 00 04 E2 C5 00 8A Example ptPck gt tData unParam tAddDelArpEntry abEthernetAddr 0 0x00 ptPck gt tData unParam tAddDelArpEntry abEthernetAddr 1 0x04 ptPck gt tData unParam tAddDelArpEntry abEthernetAddr 2 OxE2 ptPck gt tData unParam tAddDelArpEntry abEthernetAddr 3 0xC5 ptPck gt tData unParam tAddDelArpEntry abEthernetAddr 4 0x00 ptPck gt tData unParam tAddDelArpEntry abEthernetAddr 5 0x8A if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask Ie CK 10 el DIR S ERT TLR_POOL_PACKET_REI return TLR_E_FAIL S T Wb SOx 8 HAST jOCIRNSO Sic yore INLC OI Beet 7 TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The applic
15. typede amp struct TCPIP_PACKET_IP_CMD_PING_REO Ttag TLR_PACKET_HEADER_T tHead TCPIP DATA IP CMD PING REQ T Daran TCPIP_PACKET_IP_CMD_PING_REQ T Packet description Structure TCPIP_PACKET_IP_CMD_PING_REQ_T Type Request Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for TCPIP_IP_xx packets ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 8 TCPIP_DATA_IP_CMD_PING_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 51 TCPIP_IP_CMD_PING_REQ ulCmd UINT32 0x20A TCPIP_IP_CMD_PING_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_IP_CMD_PING_REQ_T ullpAddr UINT32 IP address of the target system ulTimeout UINT32 Timeout for request 0 Return immediately don t wait for
16. Structure TCPIP_ARP_PACKET Variable Type Value Range Description usHardwAddrType UINT16 1 Hardware address type usProtocolType UINT16 0x0800 Protocol type usHardwSize UINT16 6 Hardware address protocol size usProtocolSize UINT16 4 Protocol size usOpCode UINT16 1 2 Op Code 1 Request 2 Response abSenderMacAddr 6 UINT8 Sender MAC address ulSenderlpAddr UINT32 Sender IP address abTargetMacAddr 6 UINT8 Target MAC address ulTargetlpAddr UINT32 Target IP address Table 104 TCPIP_ARP_PACKET ARP packet TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 122 134 6 2 20 TCPIP IP CMD ICMP IND ICMP indication has been received This command TCPIP_IP_CMD_ICMP_IND will be sent to an application in case of an ICMP request has been received by the Tcplp stack To receive this indication the application needs to register it self using the command TCPIP_IP_CMD_SET_PARAM_REQ with mode IP_PRM_REGISTER_ICMP_APP set The indication packet itself requires no response packet to be built by the application Using just the Macro TLS_QUE_RETURNPACKET will return the packet back to the TCP_UDP task context Packet structure typedef MORTEARPACKEDEPREES EUC G HEHE GAN DEN DEREN ER DER EC LR_UINT8 bType LR_UINT8 bCode LR_UINT16 usChecksum LR_UINT8 abData_ T
17. DOC050201API13EN Revision 13 English 2015 09 Released Public 119 134 BINRT ISIE IRISIS SIONS _ICINID IE HENRI Eike Hilscher 2005 2015 The application interface 120 134 6 2 19 TCPIP TCP UDP CMD ACD CONFLICT IND Address conflict occurred This command TCP IP_TCP_UDP_CMD_ACD_CONFLICT_IND will be sent to an application in case of an ip address conflict being detected To receive this indication the application needs to register it self using the command TCPIP_IP_CMD_SET_PARAM_REQ with mode IP_PRM_REGISTER_ACD_APP set The indication packet itself requires no response packet to be built by the application Using just the Macro TLS_QUE_RETURNPACKET will return the packet back to the TCP_UDP task context Packet structure Address conflict reasons define TCPIP_ACD_CONFL_RSN_DEFAULT define TCPIP_ACD_CONFL_RSN_DEFENDED_IP 2 LA ACD States gt bAcdActivity define TCPIP_ACD_CONFLICT_STATE_PROBING A define TCPIP_ACD_CONFLICT_STATE_ONGOING_DETECTION 2 A define TCPIP_ACD_CONFLIC as SEMI_ACTIVE 3 Structure of data area of an Ethernet ARP packet typedef struct LR_UINT16 usHardwAddrType LR_UINT16 usProtocolType LR_UINT8 usHardwSize LR_UINT8 usProtocolSize LR_UINT16 usOpCo
18. ulDest UINT32 Destination queue handle of AP task process queue ulSrc UINT32 Source queue handle of TCP_UDP task process queue ulDestld UINT32 0 2 1 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process ulSrcld UINT32 O Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 99 TCPIP_TCP_UDP_CMD_SHUTDOWN_IND ulCmd UINT32 0x314 TCPIP_TCP_UDP_CMD_SHUTDOWN_IND Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Table 98 TCPIP_TCP_UDP_CMD_SHUTDOWN_IND Indication command for shutdown of the stack TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet status error 116 134 Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 99 TCPIP_TCP_UDP_CMD_SHUTDOWN_IND Packet status error Source code example TLR_RESULT ApTcpUdpCmdShutdownInd TCPIP_AP_TASK_RSC_T HARD le Ser TCEPRTERPACKETAICEAUDEACMDAS HUNDONNETN DAEAR PEREK LR_RESULT eRslt MERI _IYNC Ia NC ies IIE
19. TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Status error codes overview 130 134 Hex Value Definition Description 0xC0080312 LR_E_TCP_ERR_TIMEOUT_TCP_UDP_CMD_CLOSE_ALL The TCP Close timeout has expired One or more connections to remote host s could not be closed gracefully within this time For this timeout see command TCPIP_TCP_UDP_CMD_CLOSE_ALL_REO parameter ulTimeout 0xC0080313 LR_E_TCP_ERR_TIMEOUT_TCP_CMD_WAIT_CONNEC The TCP Connect timeout has expired No remote host has connected within this time For this timeout see command TCPIP_TCP_CMD_WAIT_CONNECT_REO parameter ulTimeoutListen 0xC0080314 TLR_E_TCP_ERR_TIMEOUT_TCP_CMD_CONNECT The TCP Connect timeout has expired A connection to the specified remote host could not be established within this time For this timeout see command TCPIP_TCP_CMD_CONNECT_REO parameter ulTimeoutConnect 0xC0080315 LR_E_TCP_ERR_TIMEOUT_TCP_CMD_SEND The TCP Send timeout has expired by sending TCP data with command CPIP_TCP_CMD_SEND_REQ The remote host has not answered within the Send Timeout The TCP Send timeout is set in command TCPIP_TCP_CMD_WAIT_CONNECT_REO or CPIP_TCP_CMD_CONNECT_REQ parameter ul Timeout Send Default 31 s Table 106 Status Error Code
20. EN_TCPUDP_QUE Name of the TCP_UDP task process queue Table 7 TCP_UDP Task process queue The returned handle is a structure from type TLR_QUE_LINK_T and has to be used as queue handle in conjunction with the macros like TLS_OU SENDPACKET_FIFO LIFO for sending a T packet to the TCP_UDP task A source code example for understanding define TCP_TASK_NAME define EN_TCPUDP_PROC TCP_UDP ESS_QUEUE_NAME EN _TCPUDP_QUE Remote Resources from TCP_UDP task Task TCP_UDP eRslt TLR_TSK_IDENTIFY TCP_TASK_NAME task name T OE GE TEE TRUST THREE T E E amp ptRsc gt tRem hTskTcpTask task handle amp ptRsc gt tRem uToknTcpTask task token y HOSMKRSC SMe WPicroEmeolask E El WHR SOK J eRrsilic return eRslt Error eRslt TLS _QUE_IDENTIFY EN _TCPUDP_PROCESS_QUEUE_NAME queue name 27 PeERsSe_ Brocenrlskinste task instance amp ptRsc gt tRem tQueTcpTask queue handle 27 if TLR_S_OK eRslt return eRslt Error 19 _QUE_LINK_SE T_NEW_D ESTID ptRsc gt tRem tQueTcpTask 0 S_QUE un ENDPACKET FIFE tQueLink BD URSS EEE w O ptRsc gt tRem tQueTcpTask Remark The macro TLS QUE _LINK_SET_NEW_DESTID
21. SOCK_OPTION_REQ SIZE sizeof TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_REO_T E SE ACKT i CPaUDEmCMDm Chis OCK OPsE TONERE ONEJ ADER_T tHead UDP UCM GET SOCK OPTION REO Data TCPIP_PACKET_TCP_UDP_CMD_ GET _SOCK_OPTION_REQ T Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_GET_SOCK_OPTION_REQ_T Type Request Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 1 256 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to the socket handle ulSocket for request packet ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 91 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ ulCmd UINT32 0x310 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 O Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_UDP_
22. Variable Type Value Range Description ulSrcld UINT32 1 256 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 33 TCPIP_DATA_TCP_UDP_CMD_ACD_CONFLICT_IND_SIZE ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 0 Status Error ulCmd UINT32 Ox31A TCPIP_TCP_UDP_CMD_ACD_CONFLICT_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_UDP_CMD_ACD_CONFLICT_IND_T ulReason UINT32 Reason for the occurred address conflict 1 TCPIP_ACD_CONFL_RSN_DEFAULT Default address conflict reason Tcp stack ceased using IP address 2 TCPIP_ACD_CONFL_RSN_DEFENDED_IP Tcp stack defended IP address IP address is still in use bAcdActivity UINT8 1 2 3 1 TCPIP_ACD_CONFLICT_STATE_PROBING Conflict occurred in state Probing Active Phase 2 TCPIP_ACD_CONFLICT_STATE_ONGOING_DETECTION Conflict occurred in state Ongoing Detection Passive Phase 3 TCPIP_ACD_CONFLICT_STATE_SEMI_ACTIVE Conflict occurred in state Semi active probing Semi active Phase tLastConflictArp Struct ARP packet from conflict partner TCPIP_ ARP_P ACKET Table 103 TCPIP_TCP_UDP_CMD_ACD_CONFLICT_IND Indication command for an address conflict
23. LR_UINT32 ullIpAddr LRAUINTS2 gt THE T LR_UINT32 ulOptions LR_UINT8 abData TCPIP_MAX_UDP_DATA_CNT TCPIP_DATA_UDP_CMD_SEND_REO_T define TCPIP_DATA_UDP_CMD_SEND_REQ_ SIZE sizeof TCPIP_DATA_UDP_CMD_SEND_REQ_T INCI MEDC UID IE ETLE HHT typedef struct TCPIP_PACKET_UDP_CMD_SEND_REO_Ttag TLR_PACKET_HEADER_T tHead TORTPADATAMUDPACMDESENDEREQAMT tData TCPIP_PACKET_UDP_CMD_SEND_REO_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description Structure TCPIP_PACKET_UDP_CMD_SEND_ REQ T Type Request 96 134 Variable Type Head Structure TLR_PACKET_HEADER_T Value Range Description ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 1 256 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to the socket handle ulSocket for request packet ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 12 n TCPIP_DATA_UDP_CMD_SEND_REQ_SIZE n Packet data length in bytes
24. Structure TCPIP_PACKET_IP_CMD_SET_PARAM_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 0 Destination End Point Identifier untouched ulSrcld UINT32 10 275 1 Source End Point Identifier untouched ulLen UINT32 Packet data length in bytes See Table 28 TCPIP_IP_CMD_SET_PARAM_CNF Mode Description for Parameter Data unParam ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 32 TCPIP_IP_CMD_SET_PARAM_CNF ulCmd UINT32 0x205 TCPIP_IP_CMD_SET_PARAM_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 O Routing do not touch Data Structure TCPIP DATA 1P CMD SET PARAM_CNF_T ulMode UINT32 Mode Type of parameter to configure See Table 28 TCPIP_IP_CMD_SET_PARAM_CNF Mode Description for Parameter Data unParam unParam union Union unParam Confirmation Parameter data See Table 28 TCPIP_IP_CMD_SET_PARAM_CNF Mode Description for Parameter Data unParam and the following tables Table 27 TCPIP_IP_CMD_SET_PARAM_CNF Confirmation command for setting IP parameters TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 46 134 The structure of the parameter data unParam union in the Packet structure
25. The timeout parameter ul ulTimeoutInactive ulMode ulMode TCP_SOCK_KE UDP_CMD_S TCPIP_TCP ERR_TIMEOUT_I VALID_TCP_UDP_CMD_SE D_TCP_CMD_CONNECT The timeout parameter ulTimeoutSend and or ulTimeoutConnect in command ECT_REO is invalid SOCK_OPT TCP_SOCK_INACTIVE_ ION Timeout Send ulMode TCP_SOCK_SEND_T IMEOUT or EPALIVE_TIMEOUT in command ET_SOCK_OPTION_REQ is invalid IMEOUT or ul imeoutKeepAlive 0xC0070130 Rb TP b The mode parameter ul RR_MODE_U KNOWN_IP_C ode in command TCPIP D_S E _PARAM IP_CMD_SET_PARAM REQ is invalid 0xC0070131 RoE TPE The mode parameter ul RR_MODE_U KNOWN_IP_CMD_GI E ode in command TCPIP _PARAM IP_CMD_GET_PARAM REQ is invalid 0xC0080132 R_E_TCP_ERR_MODE The mode parameter ul invalid UNKNOWN_TCP_UDP_C D_SET_SOCK OPTION ode in command TCPIP TCP_UDP_CMD_SET SOCK_OPTION_REQ is 0xC0080133 POR SE ECP ERR_MODE UNKNOWN_TCP_UDP_C D_GET_SOCK_OPTION The mode parameter ulMode in command TCPIP_TCP_UDP_CMD_GET invalid SOCK_OPTION_REO IS 0xC0080134 R_E_TCP_ERR_MODE UNKNOWN_FATAL_DUMMY 53 ternal fatal error in module Tcpip
26. Variable Type Value Range Description ullpAddr UINT32 IP address Structure tArpEntryMac Table 37 TCPIP_IP_CMD_GET_PARAM_REO Struct tArpEntryIp of union unParam Variable Type Value Range Description abEthernetAddr LINTE 6 Ethernet address MAC address Table 38 TCPIP_IP_CMD_GET_PARAM_REO Struct tArpEntryMac of union unParam Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 39 TCPIP_IP_CMD_GET_PARAM_REO Packet status error Source code example TER RESULT ApIpCmdGetParamReq TCPIP_AP_TASK_RSC_T FAR ptRsc IED 2 VNC IE Ane C MID _ ETHIE EVRY JRO IL Biere bar WIR JOON PACKE MECE MEPER SC Sic IkLee laPo l Gyre ALR OR return TLR_E_FAIL SOW Ib Nie ESE NEW_DESTID ptRsc gt tRem tQueTcpTask 0 EID H I WINS ESE PACKE IT SING jNERPEIK TIUIRSE ScOS ENAK Eea ptPck gt tHead ulLen TCPIP_DATA_IP_CMD_GET_PARAM REO_SIZE ET ARP_ENTRY_INDEX ptPck gt tHead ulld qParOIC NSS ae Ik oe LIL Sinvelil eyo iad ptPck gt tHead ulSta 0 ptPck gt tHead ulCmd TCPIP 1P CMD GET PARAMEREO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0
27. Struct t SendArpReg of union unParam Structure tAddDelArpEntry Variable Type Value Range Description ullpAddr UINT32 IP address abEthernetAddr UINT8 6 Ethernet address MAC address Table 19 TCPIP_IP_CMD_SET_PARAM_REQ Struct tAddDelArpEnt ry of union unParam Structure tDelArpEntrylp Variable ullpAddr Type UINT32 Value Range Description IP address Table 20 TCPIP_IP_CMD_SET_PARAM_REQ Struct tDelArpEntryIp of union unParam Structure tDelArpEntryMac Variable Type Value Range Description abEthernetAddr UINTE 6 Ethernet address MAC address Table 21 TCPIP_IP_CMD_SET_PARAM_REQ Struct tDelArpEntryMac of union unParam TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 42 134 Structure tSendArpReq Variable Type Value Range Description ullpAddr UINT32 IP address abEthernetAddr UINT8 6 Ethernet address MAC address Table 22 TCPIP_IP_CMD_SET_PARAM_REOQ Struct t SendArpRegq of union unParam Structure tSendArpTmtReq Variable Type Value Range Description ullpAddr UINT32 IP address abEthernetAddr UINT8 6 Ethernet address MAC address ulStationCntAbort UINT32 0 OxFFFFOOOO Count of received stations when the command aborts
28. 0 No station limit Table 23 TCPIP_IP_CMD_SET_PARAM_REO Struct t SendArpTmt Reg of union unParam Structure tSetArpReqTmt Variable Type Value Range Description ulTimeout UINT32 100 60000 Timeout for the ARP Requests milliseconds Table 24 TCPIP_IP_CMD_SET_PARAM_REO Struct tSetArpReqTmt of union unParam Structure tRegisterlcmpService Variable Type Value Range Description ulService UINT32 0x00000001 IP_PRM_REGISTER_ICMP_SERVICE_ECHO_REQUEST Register an application for a ICMP ping indication service Table 25 TCPIP_IP_CMD_SET_PARAM_REOQ Struct tRegisterIcmpService of union unParam Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 26 TCPIP_IP_CMD_SET_PARAM_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 43 134 The application interface Source code example define REMOTE_IP_ADDR OxCOA80A6A IP address of remote host E KS 192 163 10 106 TLR_RESULT ApIpCmdSetParamReq TCPIP_AP_TASK_RSC_T FAR ptRsc WEP We ISA 12 CMIDL SI E PARAM_REQ_T ptPck K if TER POOL PACKET GET ptRsc gt tLoc hPool amp ptPck TLR S_OK return TLR_E_ FAIL
29. Structure TCPIP_PACKET_TCP_UDP_CMD CLOSE ALL REQ T Type Request Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for request packet means close all sockets ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 TCPIP_DATA_TCP_UDP_CMD_CLOSE_ALL_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 63 TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ ulCmd UINT32 0x304 TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_UDP_CMD CLOSE ALL REQ T ulTimeout UINT32 Close timeout 0 Use the individual socket s data send timeout for TCP close operation Timeout value for all TCP close operations milliseconds tog Bere Close TCP sockets immediately connection reset OxFFFFFFFF Table 62 TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ Request command for closing all sockets Packet status error Hex
30. ptRsc gt tLoc bTestSndDatatt endif ifdef SET_TEST_DATA if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask Piebekr 100 el PERES ONL Ren Ol 2A Chir 2 EEA Pa Ge Diels Cm eoet ll Olle mute Clem ae return TIRE FATE js weeyewiicin WLI S SOKE TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet structure typedef struct TCPIP_PACK RL EEE DRS INID _ CIN _ ic By TLR_PACKE it HE ADEIR tHead TCPIP_PACKET_TCP_CMD_SEND_CNF_T Packet description 93 134 Structure TCPIP_PACKET_TCP_CMD_SEND_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier untouched ulSreld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 0 Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 78 TCPIP_TCP_CMD_SEND_CNF ulCmd UINT32 0x30B TCPIP_TCP_CMD_SEND_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 0 Routing do not touch
31. sizeof TCPIP_DATA_IP_CMD_S PERG P_TCP_UDP_CMD_SHUTDOWN_IND RES command BT CONFIG REO Ty D_SET_CONFIG REO_Ttag tHead TLR_PACKET_HEADER ICP 2 IDV _ Le CIMID T SEUME ONIEPIGEER EQ T tData TCPIP_PACKET_IP_CMD_SET_CONFIG_REO_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 28 134 structure TCPIP_PACKET_IP_CMD_SET_CONFIG_REQ_T Type Request Variable Type Value Range Head structure TLR_PACKET_HEADER_T Description ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for TCPIP_IP_xx packets ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 22 TCPIP_DATA_IP_CMD_SET_CONFIG_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 9 TCPIP_IP_CMD_SET_CONFIG_REQ ulCmd UINT32 0x200 TCPIP_IP_CMD_SET_CONFIG_REQ Command ulExt
32. 65535 0xC0080141 TLR_E_TCP_ERR_MAX_DATA_LEN_EXCEEDED_UDP_CMD_SEND The maximum UDP data count nin command TCPIP_UDP_CMD_SEND_REQ has exceeded See parameter ulLen The maximum value for nis TCPIP_MAX_UDP_DATA_CNT 1472 0xC0080211 TLR_E_TCP_ERR_NO_FREE_QUEUE_ELEMENT_UDP_CMD_SEND The UDP send command TCPIP_UDP_CMD_SEND_REQ must be rejected because the list of free queue elements is empty Remark Per default configuration the initial size of this list is 128 Every send command TCP IP_TCP_CMD_SEND_REQ or TCPIP_UDP_CMD_SEND_REQ occupy one queue element until the confirmation command is given back to the application To avoid this resource problem the application must reduce the count of open send jobs over all sockets 0xC0080212 TLR_E_TCP_ERR_NO_ETH_OUT_BUFFER_UDP_CMD_SEND The UDP send command TCPIP_UDP_CMD_SEND_REQ must be rejected because all outgoing Ethernet buffers are occupied 0xC0080214 TLR_E_TCP_ERR_ETH_OUT_SEND_BUFFER The send of the outgoing Ethernet buffer has failed The reason of this error is normally a resource problem there is no EDD buffer available 0xC0080305 TLR_E_TCP_ERR_DEST_UNREACHABLE_UDP_CMD_SEND Command TCPIP_UDP_CMD_SEND_REO The destination host network or port is unreachable Table 82 TCPIP_UDP_CMD_SEND_CNF Packet status error Note A confirmation command reporting no error does not guarantee that the data was successfully received by the communic
33. English 2015 09 Released Public Hilscher 2005 2015 The application interface 74 134 Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC000001A R_E_REQUEST_RUNNING Request is already running 0xC0080070 TLR_E_TCP_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC0080079 R_E_TCP_ERR_CONN_RESET The connection has closed by reset Hard close 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080121 R_E_TCP_ERR_TIMEOUT_INVALID_TCP_UDP_CMD_CLOSE The timeout parameter ul Timeout in command TCPIP_TCP_UDP_CMD_CLOSE_REO is invalid Consider the distinction between TCP and UDP sockets For UDP sockets ulTimeout must be zero 0xC0080301 TLR_E_TCP_ERR_DEST_UNREACHABLE_TCP_UDP_CMD_CLOSE Command TCPIP_TCP_UDP_CMD_CLOSE_REO The destination host network or port is unreachable 0xC0080311 TLR_E_TCP_ERR_TIMEOUT_TCP_UDP_CMD_CLOSE The TCP Close timeout has expired A connection to the remote host c
34. Pebekr 100 ET_RELEAS each Ares E_FAIL porun ll WLR IS ONE iR Packet structure typedef struct TC PIIP BACIK a EE SOHEL S IIE EGET Di x SC pERS C EH eEG y EI REES ORS BELC er CINDE_Wic ale H EAD PERSEA Ia I ER_T tHead TCPIP_PACKET_TCP_UDP_CMD_CLOSE_CNF_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 73 134 Structure TCPIP_PACKET_TCP_UDP_CMD_CLOSE_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier untouched ulSrcld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 O Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 61 TCPIP_TCP_UDP_CMD_CLOSE_CNF lucmd UINT32 0x303 2 TCPIP_TCP_UDP_CMD_CLOSE_CNF Command luet UINT32 lo Extension untouched ulRout UINT32 0 Routing do not touch Table 60 TCPIP_TCP_UDP_CMD_CLOSE_CNF Confirmation command for closing a socket TCP IP Packet Interface DOC050201API13EN Revision 13
35. Request is already running 0xC0080070 LR_E_TCP_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC0080079 LR_E_TCP_ERR_CONN_RESET The connection has closed by reset Hard close 0xC00800C8 LR_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080102 LR_E_TCP_ERR_IP_ADDR_INVALID_TCP_CMD_CONNECT The IP address parameter ul IpAddr in command TCPIP_TCP_CMD_CONNECT_REO is invalid The parameter ulIpAddr must be unequal to the TCP IP stacks own IP address 0xC0080106 TLR_E_TCP_ERR_IP_ADDR_INVALID_NO_GATEWAY The IP address parameter ulIpAdar is invalid because there is no gateway configured The parameter ulIpAddr must be inside the local network TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 89 134 CPIP_ CP_CMD_CON Hex Value Definition Description 0xC0080111 TLR_E_TCP_ERR_PORT_INVALID_TCP_CMD_CONNECT The port parameter ulPort in command TCPIP_TCP_CMD_C
36. The timeout value specified in the request command will apply to TCP sockets only UDP sockets will always be closed immediately If a timeout value unequal zero is given this timeout will be valid for all TCP sockets that have to be closed If the timeout is set to zero the current timeout for data send operations on the individual TCP socket will be used TCP connections that time out during the close operation will automatically be aborted with a TCP connection reset A possible use of the TCPIP_TCP_UDP_CMD_CLOSE_ALL command is to free all allocated socket resources once the application ends communication to the stack Packet structure typedef struct TCPIP_DATA_TCP_UDP_CMD_CLOSE_ ALL _REO Ttag HR HERNIE S 92T oe ACID I DENN AED SIS TT TTI O T ap define TCPIP_DATA_TCP_UDP_CMD CLOSE SHE REQ SIZE sizeof TCPIP_DATA_TCP_UDP_CMD_CLOSE_ALL_REQ_T typedef struct TCPIP_PACKET_TCP_UDP_CMD_CLOSE_ALL_REQ Ttag TLR_PACKET_HEADER_T tHead EE IDYANIAC e_UD2 CMID CMOS I ANIL IRUEO _ te Deine TCPIP_PACKET_TCP_UDP_CMD_CLOSE_ALL REQ T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 76 134 Packet description
37. TC DDP CMD RECEIVE TND eee 18 Figure 14 UDP communication example TCPIP_UDP_CMD_SEND_REQ CNE sese 19 Figure 15 UDP communication example TCPIP_TCP_UDP_CMD_CLOSE_REQO CNF eee 19 TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 134 134 Appendix 8 3 Contacts Headquarters Germany Hilscher Gesellschaft f r Systemautomation mbH Rheinstrasse 15 65795 Hattersheim Phone 49 0 6190 9907 0 Fax 49 0 6190 9907 50 E Mail info hilscher com Support Phone 49 0 6190 9907 99 E Mail de support hilscher com Subsidiaries China Hilscher Systemautomation Shanghai Co Ltd 200010 Shanghai Phone 86 0 21 6355 5161 E Mail info hilscher cn Support Phone 86 0 21 6355 5161 E Mail cn support hilscher com France Hilscher France S a r l 69500 Bron Phone 33 0 4 72 37 98 40 E Mail info hilscher fr Support Phone 33 0 4 72 37 98 40 E Mail fr support hilscher com India Hilscher India Pvt Ltd New Delhi 110 025 Phone 91 11 40515640 E Mail info hilscher in Italy Hilscher Italia srl 20090 Vimodrone MI Phone 39 02 25007068 E Mail info hilscher it Support Phone 39 02 25007068 E Mail it support hilscher com Japan Hilscher Japan KK Tokyo 160 0022 Phone 81 0 3 5362 0521 E Mail info hilscher jp Support Phone 81 0 3 5362 0521 E Mail jp support hilscher com
38. Table 75 TCPIP_TCP_CMD_SEND_REO TCP send options ulOptions TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 92 134 Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 76 TCPIP_TCP_CMD_SEND_REO Packet status error Source code example TLR_RESULT ApTcpCmdSendReq TCPIP_AP_TASK_RSC_T FAR ptRsc TLR_UINT uiSendLen WEP E NC ST Cle I GET Sia iN ERS I jaiclexelee TLR_UINT uildx Data index af iain OOhmPACKiimeGE InN plEnse TEO CA NEOO lly Oe ek ETRS AOK return TLR_E_FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask ptRsc gt tLoc ulSocket SEO U ERE EUNKEES Liles ACKiiim Sh Cano le gt CK PERS Cll ETIE T TE ptPck gt tHead ulLen TCPIP_DATA_TCP_CMD_SEND_REQ_ SIZE uiSendLen ptPck gt tHead ulld AGE ST OT BroealleneiiepHer ptPck gt tHead ulSta 0 ptPck gt tHead ulCmd TCPIP_TCP_CMD_SEND_REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 DIR eK ED ea WO Eon SE IES SEND Ow PUSHA SENT here ifdef SET_TEST_DATA for uildx 0 uildx lt uiSendLen uildx TCPIP_PACKET_TCP_CMD_SEND_REQ T ptPck gt tData abData uildx
39. Table 77 TCPIP_TCP_CMD_SEND_CNF Confirmation command for sending TCP data Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC000001A R_E_REQUEST_RUNNING Request is already running 0xC0080070 R_E_TCP_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC0080074 R_E_TCP_ERR_OPTION_NOT_SUPPORTED_TCP_CMD_SEND The option parameter ulOptions in command TCPIP_TCP_CMD_SEND_REO is invalid 0xC0080078 R_E_TCP_ERR_CONN_CLOSED The connection has closed Graceful close 0xC0080079 R_E_TCP_ERR_CONN_RESET The connection has closed by reset Hard close 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 94 134
40. U D e _ CIMID _ Gaye SOC ON OWN H EVAR PETECE TLR_RESULT Rslt ptPck gt tHead ulSta if TLR_S_OK eRslt if ptPck gt tData ulMode TCP_SOCK_SEND_TIMEOUT ptRsc gt tLoc ulTimeoutSend ptPck gt tData unParam ulTimeoutSend Fa else lien el TLR_POOL_PACKET_RELEASE ptRsc gt tLoc hPool ptPck return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 112 134 6 2 16 TCPIP_TCP_UDP_CMD_RECEIVE_IND Receiving TCP data and UDP data Data received from the network for a TCP socket or a UDP socket will be sent to the application in an indication command according to the description below The indication packet itself requires no response packet to be built by the application Using just the Macro TLS_QU An additional command TcP1 E RETURNPACK P_TCP_UDP_CMD_R ECEI b V ET will return the packet back to the TCP_UDP task context E_STOP with Status field ulSta holding an error code will be sent to the application in case of a connection being closed or reset This command can be treated as an end of data marker because no more receive data commands from this socket will be sent to the application afterwards Packet structure Options of packet ulOptions variable
41. nis the Application data count of abData 1472 in bytes n 1 TCPIP_MAX_UDP_DATA_CNT 1472 ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 80 TCPIP_UDP_CMD_SEND_REO ulCmd UINT32 0x30C TCPIP_UDP_CMD_SEND_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_UDP_CMD_S END REQ _T ullpAddr UINT32 Target IP address ulPort UINT32 0 65535 Target Port number ulOptions UINT32 0 Options Reserved for future use abData 1472 UINT8 Application data with length n see also ulLen Table 79 TCPIP_UDP_CMD_SEND_REO Request command for sending UDP data Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 80 TCPIP_UDP_CMD_SEND_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Source code example define REMO define REMOTE_PORT E IP ADDR OxCOA80A6A 1028 LR_RESULT ApUdpCmdSendReq TCPIP_AP_TASK_RSC_T FAR ptRsc TES UHEL uiSendLen TCPTEPMPACKETAMUDERCMDESENDSRE OM ARPER TITAN
42. set ulDestid for all further calls of TLS_OUE_SENDPACKET 0 for _FIFO The parameter ulDestId is IP layer commands TCPIP_IP_xx and command TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ ulSocket socket handle for socket based commands TCPIP_TCP UDP_xx ulSocket is the ulDest 1 TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 d parameter from confirmation command TCP IP_TCP_UDP_CMD_OPEN_CNF The application interface 27 134 6 2 1 TCPIP_IP_CMD SET _CONFIG_REQ CNF Providing configuration data Using this command the IP layer can be provided with new configuration parameters If any sockets are open when the TC PIP it will send a TCPIP_TCP_UDP_CMD_SHUTDOWN_ IP_CMD_SET_CONFIG_REO command is received by the stack IND command to the owner of the socket Please refer to the section TCPIP_TCP_UDP_CMD_SHUTDOWN_IND RES Shutdown ofthe at page 115 to learn more about the handling of the TCP1 Packet structure typedef struct TCPIP_DATA_IP_CMD_SET_CONFIG_R EQ Ttag LR_UINT32 ulFlags LR_UINT32 ullIpAddr LR_UINT32 ulNetMask LR_UINT32 ulGateway LR_UINT8 abEthernetAddr 6 jp ICID _ IDA _ EBEN DRS TT TO BEIN define TCPIP_DATA_IP_CMD_S ET_CO BARGEIREOBESAE E typedef struct TCPIP_PACKET
43. the associated regulations of different counters in particular those of Germany and the USA The software may not be exported to countries where this is prohibited by the United States Export Administration Act and its additional provisions You are obligated to comply with the regulations at your personal responsibility We wish to inform you that you may require permission from state authorities to export re export or import the product TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Protocol parameters 9 134 2 Protocol parameters The TCP IP stack needs some basic configuration data to be able to start Normally this configuration data will be read from a database DBM file residing in the device s flash memory It is however also possible to provide the configuration data dynamically by the AP task Configuration data sent to the TCP IP stack this way will have precedence over the data read from flash but will not be stored in flash memory Hence the dynamic configuration procedure must be executed again after each reset or power cycle of the stack 2 1 Sending configuration parameters using commands It is possible to send configuration command to the TCP IP stack TCP_UDP task The commands are explained in detail in section The application starting at page 25 2 2 Description of the protocol parameters The parameter name for example ulFlags corresp
44. 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 54 134 Structure TCPIP_PACKET_IP_CMD_GET_PARAM_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 0 Destination End Point Identifier untouched ulSrcld UINT32 10 275 1 Source End Point Identifier untouched ulLen UINT32 Packet data length in bytes See Table 41 TCPIP_IP_CMD_GET_PARAM_CNF Mode description for parameter data unParam ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 44 TCPIP_IP_CMD_GET_PARAM_CNF ulCmd UINT32 0x207 TCPIP_IP_CMD_GET_PARAM_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 O Routing do not touch Data Structure TCPIP_DATA_IP_CMD_GET_PARAM_CNF_T ulMode UINT32 Mode Type of parameter See Table 41 TCP IP_IP_CMD_GET_PARAM_CNF Mode description for parameter data unParam unParam union Union unParam Result data See Table 41 TCPIP_IP_CMD_GET_PARAM_CNF Mode description for parameter data unParam Table 40 TCPIP_IP_CMD_GET_PARAM_CNF Confirmation Command for obtaining IP Parameters The structure of parameter result data unParam union in the Packet structure depends on the M
45. End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 8 TCPIP_DATA_TCP_UDP_CMD_SET_SOCK_OPTION_REQ_ SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 85 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ ulCmd UINT32 0x30E TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP DATA TCP UDP CMD SET SOCK OPTION HEO T ulMode UINT32 Mode Type of option See Table 84 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Socket option data unParam unParam union Union unParam Data required by option See Table 84 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Socket option data unParam Table 83 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Request command for setting socket options TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface The structure of socket option unParam union in the Packet structure depends on the Mode parameter ulMode Default values are bold and underlined 102 134
46. Korea Hilscher Korea Inc Suwon 443 734 Phone 82 0 31 695 5515 E Mail info hilscher kr Switzerland Hilscher Swiss GmbH 4500 Solothurn Phone 41 0 32 623 6633 E Mail info hilscher ch Support Phone 49 0 6190 9907 99 E Mail ch support hilscher com USA Hilscher North America Inc Lisle IL 60532 Phone 1 630 505 5301 E Mail info hilscher us Support Phone 1 630 505 5301 E Mail us support hilscher com TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015
47. Released Public Hilscher 2005 2015 The application interface Packet structure typedef struct TC 98 134 PALE IPA WIDE _ CIMID _SIINID_ CINIE IHE STET TLR_PACKE at HE ADER_T tHead TCPIP_PACKET_UDP_CMD_SEND_CNF_T Packet description Structure TCPIP_PACKET_UDP_CMD_SEND_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T lulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier untouched ulSreld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 0 Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 82 TCPIP_UDP_CMD_SEND_CNF ulCmd UINT32 0x30D TCPIP_UDP_CMD_SEND_CNF Command ulExt UINT32 O Extension untouched ulRout UINT32 0 Routing do not touch Table 81 TCPIP_UDP_CMD_SEND_CNF Confirmation command for sending UDP data Packet status error The IP address parameter ul IpAdar is invalid because there is no gateway configured The parameter ulIpAddr must be inside the local network Hex Value Definition D
48. Source code example TLR_RESULT ApTcpUdpCmdGetSockOptionsReq TCPIP_AP_TASK_RSC_T FAR ptRsc WED We YN L WC le HEURT CMiD _ Gist _ SOC OR WICC RUBIO SER eike Iie WIR POO RANCH mr PERSS ACLOS INZOSGIL CjoreGie jy WR S_OK return TLR_E_FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask ptRsc gt tLoc ulSocket S_ Ol A IIN S S eeVACIXIB IE SINC joleIPCl lt PERS e A E OCRE INKES ne Peek TTI TT TT DATA TTS E TET ies OCKMORTTONERE OMS Ws Zhi ptPck gt tHead ulld er peRse Eroemnlonelepilek ptPck gt tHead ulSta 0 PeBek rheadrtii cndi ErCRITPETCPZUDPECMDECHIESOCKEOBETONEREG ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ulMode TCP_SOCK_SEND_TIMEOUT if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask CPE TOO jy Data NOK Line POOL PACK TRE LEASH GpeRSsc gt H LOO pELCl mi return TLR_E FAIL return TIER DR 15 TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 109 134 Packet structure typedef struct TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_CNF_Ttag TLR_UINT32 ulMode union In WN ile Lp LR_UINT
49. T E e BIH CINE NR fone Pole To screen eRslt ApTcpUdpCmdCloseAllReq ptRsc if TLR_S_OK eRslt Command TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ send successful eRslt TLR_QUE_WAITFORPACKET ptRsc gt tLoc hQue amp ptPckCloseAllCnf IAR IME E EME tO ZELL IF if TLR_S_OK eRslt if ptPckCloseAllCnf gt tHead ulCmd TCPIP_TCP_UDP_CMD_CLOS SEE RH ApTcpUdpCmdCloseAllCnf ptRsc ptPckCloseAllCnf ve TLS_QUE ETURNPACKET ptPck returnd eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 117 134 6 2 18 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Stop receiving of TCP data and UDP data This command TCPIP_TCP_UDP_CMD_RECEIVE_STOP with Status field ulSta holding an error code will be sent to the application in case of a connection being closed or reset This command can be treated as an end of data marker because no more receive data commands from this socket will be sent to the application afterwards The indication packet itself requires no response packet to be built by the application Using just the Macro TLS_QUE_RETURNPACKET will return the packet back to the TCP_UDP task context T Note However the socket is not automatically closed after receiving this indication The
50. Table 15 TCPIP_IP_CMD_GET_CONFIG_CNF Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 35 134 Source code example TER RESULT ApIpCmdGetConfigCnf TCPIP_AP_TASK_RSC_T TUNE TREE STG WC We DACHTE HE MID Eig COMPING ENT IF SEE joc ieee TLR_RESULT Rslt ptPck gt tHead ulSta if TLR_S_OK eRslt ptRsc gt tLoc ulFlags ptPck gt tData ulFlags ptRsc gt tLoc ullpAddr ptPck gt tData ullpAddr ptRsc gt tLoc ulNetMask ptPck gt tData ulNetMask ptRsc gt tLoc ulGateway ptPck gt tData ulGateway LIB_MEMCPY amp ptRsc gt tLoc abEthernetAddr 0 amp ptPck gt tData abEthernetAddr 0 sizeof ptPck gt tData abEthernetAddr DEREPOOTBPNGCKEIBEREIEET SEI jock Sic yore IN 2exoll joel 6 return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 36 134 6 2 3 TCPIP_IP_CMD_SET PARAM REQ CNE Setting IP parameters Some parameters of the IP layer can be modified during run time Using the TCPIP_IP_CMD_SET_PARAM command entries in the stacks ARP cache can be added or removed Furthermore an ARP send request interface is implemented modes IP_PRM_SEND_ARP_REO IP_PRM_SEND_ARP_TMT_REQ IP_PRM_SEND_ARP_TMT_REQ
51. Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 0 Destination End Point Identifier untouched ulSreld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 O Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 11 TCPIP_IP_CMD_SET_CONFIG_CNF ulCmd UINT32 0x201 TCPIP_IP_CMD_SET_CONFIG_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 O Routing do not touch Table 10 TCPIP_IP_CMD_SET_CONFIG_CNF Confirmation command for providing configuration data Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC0070034 R_E_IP_ERR_INIT_NO_ETHERNET_ADDR There is no Ethernet address MAC address available 0xC0070036 R_E_IP_ERR_INIT_INVALID_FLAG The start parameters contains one or more unknown flags 0xC0070037 R_E_IP_ERR_INIT_INVALID_IP_ADDR The start parameters contains an invalid IP address 0xC0070038 R_E_IP_ERR_INIT_INVALID_NETMASK The start parameters contains an invalid subnet mask
52. UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data structure TCPIP_DATA_IP_CMD_SET_CONFIG_REQ T ulFlags UINT32 Flags See chapter Description of the protocol at page 9 ullpAddr UINT32 IP address of the stack ulNetMask UINT32 Netmask of local subnet ulGateway UINT32 IP address of default gateway abEthernetAddr 6 UINT8 Ethernet address MAC address of the device Table 8 TCPIP_IP_CMD_SET_CONFIG_REQ Request command for providing configuration data Packet status error Hex Value Definition Description 0x00000000 TLR_S_ OK Status ok Table 9 TCPIP_IP_CMD_SET_CONFIG_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Source code example 29 134 define LOCAL _IP_ADDR OxCOAS8OACF Own IP address 192 168 10 207 define LOCAL_NET_MASK OxFFFFFF0O0 Own Netmask BSNS 2556 B95 5 0 ey define LOCAL_GATEWAY OxCOA80A0A Gateway 192 16 LO 5 10 S LR_R
53. Value Definition Description 0x00000000 TLR_S_OK Status ok Table 63 TCPIP_TCP_UDP_CMD_CLOSE_ALL_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 77 134 Source code example TLR_RESULT ApTcpUdpCmdCloseAllReg TCPIP_AP_TASK_RSC_T FAR ptRsc IEEE EDEN DBECND ERENTO ETT L oe eeike if TLR POOL PACKET GET ptRse gt tLoe hPool amp ptPek TLR_S_OK return TLR_E_FAIL iS_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask 0 Om OULME MNKs Piles ACK Gms Ci Mole CK I PERS C TIE T Omni ptPck gt tHead ulLen TCPIP_DATA_TCP UDP CMD CLOSE ALT REO SIZE ptPck gt tHead ulld un peRse et LOC LSO e el ptPck gt tHead ulSta Op ptPck gt tHead ulCmd TCRIP_ TUR UDP EMDT ELOSE ALL REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ulTimeout 0 Use the individual socket s data send timeout for TCP close operation a la TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask IEP el 100 y LS AIL IS Ole MER IOC IAN E A IRGNLEVASIE joICIRNSC Sc llyoxe IN2BO OL jorElerele 5 return TLR_E FAIL SG T AERO 8 TCP IP Packet
54. an ICMP Echo Reply packet 1 231 4 Wait up to specified time for return of an ICMP Echo Reply packet time in milliseconds Table 50 TCPIP_IP_CMD_PING_REO Request command for sending a ping TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 61 134 Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 51 TCPIP_IP_CMD_PING_REO Packet status error Source code example define REMOTE_IP_ADDR OxCOA80A6A IP address of remote host K E 192 188 10 5 LOG wf THR RESULT ApIpCmdPingReq TCPIP_AP_TASK_RSC_T FAR ptRsc WE WP PACKEN 112 CM IP ING L E LE SI WILIR XO YN Gi NE ELT HT TIE j WR SOK BCEA RERA ESRA ILI iS_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask 0 SEO UEEE DENKENS Hil meD ACK GES RC Gs ple PET RAPERS C EOC EINK la Cum ier ptPck gt tHead ulLen TCPIP_DATA_IP_CMD_PING_REO_SIZE ptPck gt tHead ulld PISCE Hic LOS WL Siayeliteyoicely ptPck gt tHead ulSta 0 ptPck gt tHead ulCmd TCPIP_ IP CMD_PING_REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ullpAddr REMOTE_IP_ADDR ptPck gt tData ulTimeout 1000 a ES
55. based communication is to open a socket of the desired protocol type Therefore a TCPIP_TCP_UDP_CMD_OPEN request command should be sent to the stack The stack will return a confirmation command containing the handle of the socket just opened When the confirmation command is returned the TCP client application can proceed to the next step which establishes a connection to the TCP server This will be accomplished by sending a TCPIP_TCP_CMD_CONNECT command to the stack TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 13 134 re ST TOP_CNMD_CONNECT Request Command TCP Connection Establishment Socket er TCP_CMD_CONNECT Confirmation Command Device Figure 2 TCP client example TCPIP_TCP_CMD_CONNECT_REO CNF The device then contacts the server owning the IP address given in the TCPIP_TCP_CMD_CONNECT request command If the connection could be established a confirmation command reporting success will be returned to the application In case the IP address cannot be found or the server refuses the connection the confirmation command will contain an error code indicating the reason of failure H Dl
56. connect command 0 Wait until connection comes in T Wait up to specified time for incoming connection time in milliseconds Table 66 TCPIP_TCP_CMD_WAIT_CONNECT_REQ Request command for waiting for an incoming TCP connection Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 67 TCPIP_TCP_CMD_WAIT_CONNECT_REQ Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 82 134 The application interface Source code example TLR_RESULT ApTcpCmdWaitConnectReq TCPIP_AP_TASK_RSC_T FAR ptRsc TOCETEPAPACKETETCEECNMNDPENANITECONNE CIMERE ONIA EEEE if TER POOL PACKET GET ptRsc gt tLoc hPool amp ptPck EEROR return TLR_E FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask ptRsc gt tLoc ulSocket ROVERIN SSE PACRKEMESRCNIPtEEek PERS e ali O CL ELAKS CERI ptPck gt tHead ulLen TCPIP_DATA_TCP_CMD_WAIT_CONNECT_REQ_SIZE ptPck gt tHead ulld qPar Ole RUSS I THT EE ptPck gt tHead ulSta 03 ptPck gt tHead ulCmd TEPIP_TEP CMD WALT CONNECT REQ ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ulTimeoutSend 0 S 0 Berau ke wiimsant Sl s
57. connect to ulPort UINT32 1 65535 Port number of remote server to connect to ulTimeoutSend UINT32 Send timeout Timeout for future send commands 0 Default timeout 31000 milliseconds Tarzi Wait up to specified time for successful transfer data time in milliseconds ulTimeoutConnec UINT32 Connect Timeout Timeout for connect command t 0 Default timeout 31000 milliseconds a Wait up to specified time for connection time in milliseconds Table 70 TCPIP_TCP_CMD_CONNECT_REQ Request command for establishing a TCP connection Packet status error Hex Value 0x00000000 TLR_S_OK Status ok Definition Description Table 71 TCPIP_TCP_CMD_CONNECT_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Source code example define REMOTE_IP_ADDR OxCOA80A6A IP address of remote host fe 192 169 10 106 define REMOTE_PORT 1028 TCP UDP port of remote host LR_RESULT ApTcpCmdConnectReq TCPIP_AP_TASK_RSC_T FAR ptRsc WEP We JN wa EI SERENDESONN EC RO MEORE SLi WWI JOO WYN Cini jOeINSE Sc LOC Iaooll yer
58. data which is transferred to the server application using TCPIP_TCP_UDP_CMD_RECEIVE indication commands TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 17 134 UL TOP_CMD_SEND Request Command L Data v Acknowledge Socket o TCP_CMD_SEND Confirmation Command Device Figure 10 TCP server example TCPIP_TCP_CMD_SEND_REQ CNF After processing the request the server sends response data back to the client by means of TCPIP_TCP_CMD_SEND commands 0 0 ozo ee TOP_UDP_CND_CLOSE Request Command TCP Connection Termination lt Socket gt TCP_UDP_CMD_CLOSE Confirmation Command Device Figure 11 TCP server example TCPIP_TCP_UDP_CMD_CLOSE_REQ CNF Once the data is transferred the server sends a TCPIP_TCP_UDP_CMD_CLOS to the stack in order to terminate the TCP connection and to close the socket E request command TCP IP Packet Interface DOC050201API13EN
59. depends on the Mode parameter ulMode Mode ulMode Description union element of ulLen unParam IP_PRM_ Add static entry to ARP n a TCPIP_DATA_ ADD_ARP_ENTRY cache IP_CMD_SET_PARAM_CNF_SIZE 1 4 IP_PRM_ Delete entry from ARP n a TCPIP_DATA_ DEL_ARP_ENTRY cache IP_CMD_SET_PARAM_CNF_SIZE 2 4 IP_PRM_ Delete entry from ARP n a TCPIP_DATA_ DEL_ARP_ENTRY_IP cache IP_CMD_SET_PARAM_CNF_SIZE 3 4 IP_PRM_ Delete all entries with n a TCPIP_DATA_ DEL_ARP_ENTRY_MAC specified MAC address from IP_CMD_SET_PARAM_CNF_SIZE 4 ARP cache 4 IP_PRM_ Sends an ARP request tSendArpCnf TCPIP_DATA_ SEND_ARP_REQ ARP send request IP_CMD_SET_PARAM_CNF_SIZE 5 interface SEND_ARP_REQ 14 IP_PRM_ Sends an ARP request tSendArpTmtCnf TCPIP_DATA_ SEND_ARP_TMT_REQ ARP send request IP_CMD_SET_PARAM_CNF_SIZE 6 interface Searches for SEND_ARP_TMT_REQ_MIN more stations 22 6 ulStationCnt IP_PRM_ Set timeout for ARP n a TCPIP_DATA_ SET_ARP_REQ_TMT requests global value for IP_CMD_SET_PARAM_CNF_SIZE 7 every ARP request 4 IP_PRM_ Register Application for n a TCPIP_DATA_ REGISTER_ACD_APP ACD conflict indications IP_CMD_SET_PARAM_CNF_SIZE 8 4 IP_PRM_ Register app
60. drop the ip address in case of a conflict a TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The startup parameters 23 134 Min Default Max Cycletime of TCP_UDP task in ms ulTcpCycleEvent define TCPIP_SR CPUCYCLESEVENT MIN 5 define TCPIP_SRT_TCP_CYCLE_EVENT_DEFAULT 10 define TCPIP_SR CP_CYCLE_EVENT_MAX 20 Min Default Max count of fr queu lements ulQueFreeElemCnt define TCPIP_SRT_QUE_FREE_ELE CNT_MIN 4 define TCPIP_SRT_OUE_FREE_ELEM_CNT_DEFAULT 128 Default Suggestion 8 per socket yf define TCPIP_SRT_QUE_FREE_ ELEM CNT MAX 4096 Maximum 32 per socket max count 128 32 Min Default Max socket count ulSocketMaxCnt define TCPIP_SRT_SOCKET_MAX_CNT_MIN 1 define TCPIP_SRT_SOCKET_MAX_C DEFAULT 16 define TCPIP_SRT_SOCKET_MAX_CNT_MAX 128 Max socket count is LOK Min Default Max size of Number of entries in ARP cache ulArpCacheSize define TCPIP_SRT_ARP_CACHE_SIZE_MIN 16 define T
61. if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask Pebekr 1 00 el LERES AOK TIRABOOLARACKETERENEASENIPERSC E ET joreleyel lt 5 reburad R n VAIE T EVE H WIKI IS Ol p Packet structure typedef struct TCPIP_DATA_TIP_CMD_PING_CNF_Ttag TLR_UINT32 ulResponseTime TEPIP_DATA_1P_CMD_PING_CNE_T define TCPIP_DATA_IP_CMD_PING_CNF_SIZE sizeof TCPIP_DATA_IP_CMD_PING_CNF_T typedef struct TCPIP_PACKET_IP_CMD_PING_CNF_Ttag TLR_PACKET_HEADER_T tHead ICIS DAIWA IPs CMID _ IP IUINE Cini Pe STET TCPIP_PACKET_IP_CMD_PING_CNF_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 62 134 Structure TCPIP_PACKET_IP_CMD_PING_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 0 Destination End Point Identifier untouched ulSrcld UINT32 10 275 1 Source End Point Identifier untouched ulLen UINT32 4 TCPIP_DATA_IP_CMD_PING_CNF_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 53 TCPIP_IP_CMD_PING_CNF ulCmd UINT3
62. nenen 124 Lea T TT 131 BA LIStOf taD Si n ondan SPREICTEEENSPOE LHERLETTETSEE SELFERLSTEESSCPERELFELLELFERTBFIREPELTLERETTEEIEERELTTERESELERERN 131 8 2 HISTO MOUTO erir ee a a a IRE REALAS EERROR AKAOA OREA LLE EAA IERRA RARR E AREER AR 133 EC 10 51 a a ara NEE A EA TTT 134 TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Introduction 3 134 1 Introduction 1 1 About this document This manual describes the application interface of the TCP IP and UDP IP protocol stack Use this manual to support and guide you through the integration process of the given stack into your own application This stack was developed based upon Hilscher s Task Layer Reference Programming Model This programming model is a description of how to develop a task in general which is a convention defining a combination of appropriate functions belonging to the same task Furthermore it defines how different tasks have to communicate with each other in order to exchange their data The Reference Model is commonly used by all developers at Hilscher and shall be used by you as well when writing your application task on top of the stack 1 1 1 List of revisions Rev Date Name Chapter Revision 10 2009 08 06 VD TCP IP stack version V2 0 14 0 Added Socket option TOS Type of Service Actualized Error messages 11 2010 05 27 VD TCP IP stack version V2 0 16 0 Added startup parameter pszH
63. ptPck gt tData ulTimeoutListen 0 0 Wait until connection comes in if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask PeBekr 100 He AMEE IS LOKI SITE E Ol DA ChE a REE EAS Hy IPERS C troek ET ECK reburay TERSESFATL iy Fetural TER S OK ye Packet structure typedef struct TCPIP_DATA_TCP_CMD_WAIT_CONNECT_CNF_Ttag LR_UIN LR_UIN 32 82 ullpAddr TROTS TCPIP_DATA_TCP_CMD_WATT_CONNECT_CNE_T r define TCPIP_DATA_TCP_CM D_WAIT_CONNECT_CNF_SIZE typedef struct TC TLR_PACKET_HEADER_T RIRE _DAMA_ IC CIMID NACIE N TEONININEL ZONE ZA tHead tData TCPIP_PACKET_TCP_CMD_WAIT_CONNECT_CNE_T PILE _ IVAN Ig INCI CMID _ AICI _ CONNINIIC IE _ CANIN IM eve sizeof TCPIP_DATA_TCP_CMD_WAIT_CONNECT_CNF_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 83 134 Structure TCPIP_PACKET_TCP_CMD_WAIT_CONNECT_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier untouched Handle o
64. queue handle of AP task process queue ulDestld UINT32 1 256 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to the socket handle ulSocket for request packet ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 n TCPIP_DATA_TCP_CMD_SEND_REQ_SIZE n Packet data length in bytes nis the Application data count of abData 1460 in bytes n 1 TCPIP_MAX_TCP_DATA_CNT 1460 ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 76 TCPIP_TCP_CMD_SEND_REO ulCmd UINT32 Ox30A TCPIP_TCP_CMD_SEND_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP DATA TCP CMD SEND HEO T ulOptions UINT32 Options See Table 75 TCPIP_TCP_CMD_SEND_REQ TCP send options ulOptions abData 1460 UINTE Application data with length n see also ulLen Table 74 TCPIP_TCP_CMD_SEND_REO Request command for sending TCP data The ulOptions parameter holds the option data in a bit oriented format Bits Name Bit mask Description 31 1 Reserved Reserved for future use 0 TCP_SEND_OPT_PUSH Push flag If set the stack send the data immediate 0x00000001
65. request command in order to close the corresponding socket TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The startup parameters 20 134 5 The startup parameters The startup parameter structure has to be used to parameterize the TCP IP stack at link time These parameters are defined in the rcX configuration file for example Config_netX c The following startup parameter structure is declared in header file TcpipTcpTask_Functionlist h The meaning of the parameters is explained directly in the structure below See also the following Startup Parameter Limits Note The actual version of the startup parameters ulParamVersion is TCPIP_STARTUPPARAMETER_VERSION_5 5 Furthermore the task identifier ulTaskIdentifier must be TLR_TASK_TCPUDP See also the following source code example Startup parameter structure typedef struct TCPIP_TCP_TASK_STARTUPPARAMETER_Ttag LR_UINT32 ulTaskIdentifier task identifier see TLR_TaskIdentifier h LR_UINT32 ulParamVersion structure version A es Ko TCPIP_STARTUPPARAMETER_VERSION_5 5 TCP IP stack V2 0 16 0 1 A fers ONS Poal E Balzers woe TLR_UINT32 ulQueElemCntAp TCP IP stacks process queue size for AP if packets zi Remark The real queue size is th
66. server application puts this socket into listening state by sending a TCPIP_TCP_CMD_WAIT_CONNECT request command The stack defers the confirmation command to this request command as long as the socket is waiting for an incoming connection TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 16 134 TCP Connection Establishment Socke TCP_CMD_WAI T_CONNECT Confirmation Command Device Figure 8 TCP server example TCPIP_TCP_CMD_WAIT_CONNECT_CNF Once a connection request is detected it is processed and the socket is no longer listening The result of the connection establishment is returned in the TCPIP_TCP_CMD_WAIT_CONNECT confirmation command then If successful the socket will be connected to the client that initiated the connection D Data v Micknowledge Socket IE gt TCP_UDP_CND_RECEI VE Request Command t m SIS TCP_UDP_CMD_RECEI VE Request Command Device De gt TCP_UDP_CMD_RECEI VE Request Command Figure 9 TCP server example TCPIP_TCP_UDP_CMD_RECEIVE_IND The server then awaits the client s request
67. sockets and it will work the following way The stack will send its connection termination request and will then wait up to the specified time for the remote TCP stack to close the connection too graceful close If the timeout is exceeded a TCP connection reset will be forced hard close A connection reset will always be performed if the timeout value is set to 1 OoxFFFFFFFF Note Please note that the TCPIP_TCP_UDP_CMD_CLOSE confirmation command will be delayed for 2 seconds for TCP sockets if the local TCP stack was the one which initiated the TCP connection termination active close UDP sockets will always be closed immediately The timeout value must be set to zero in this case Packet structure typeder struct TCPIP_ DATA _ TCP _UDP_CMD_ClOSE_REO_Ttag LR_UINT32 ulTimeout We I IDVAIWA IWC DEREN DEREITO SIERT OR define TCPIP_DATA_TCP_UDP_CMD_CLOSE_REQ_SIZE SIE oO CP UPD ATA CBEUDBEENDECHOSHEREOEN N typeder Struct TCPIP_PACKET_TCP_UDP_CMD_CLOSE_REQ_Ttag TLR_PACKET_HEADER_T tHead B PIBEDZIPAETCERVUDBRECMDRCTOSERREORRT tData TCPIP_PACKET_TCP_UDP_CMD_CLOSE_REO_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description Structure TCPIP
68. 05 2015 The application interface 90 134 6 2 12 TCPIP_TCP_CMD SEND_REQ CNF Sending TCP data The TCPIP_TCP_CMD_SEND request command can be used to transfer data to the TCP communication partner The only required parameter besides the actual data to be transferred is a handle of a socket in established state That means this socket has to be connected to the remote communication partner using the TCPIP_TCP_CMD_WAIT_CONNECT or TCPIP_TCP_CMD_CONNECT commands beforehand Up to TCPIP_MAX_TCP_DATA_CNT 1460 bytes of data can be sent in a single packet The request command will be confirmed with a confirmation command by the stack when the data has been acknowledged by the remote TCP IP stack Afterwards the next TCPIP_TCP_CMD_SEND request command can be sent to the stack see note below Each data block sent this way is subject to timeout supervision If the data cannot be delivered within the time specified in the TCPIP_TCP_CMD_WAIT_CONNECT or TCPIP_TCP_CMD_CONNECT command the connection will be aborted Note The application must not wait for the TCP IP_TCP_CMD_SEND confirmation command to send the next TCPIP_TCP_CMD_SEND request command The stack can buffer up to ulQueFreeElemCnt Startup parameter Default TCPIP_SRT_QUE_FREE_ELEM_CNT_DEFAULT 128 application request commands over all sockets In this case the stack sent the data depending on the actual window size of the remote TCP IP st
69. 2 0x20B TCPIP_IP_CMD_PING_CNF Command ulExt UINT32 O Extension untouched ulRout UINT32 0 Routing do not touch Data Structure TCPIP_DATA_IP_CMD_PING_CNF_T ulResponseTime UINT32 Response time of the Ping answer milliseconds Table 52 TCPIP_IP_CMD_PING_CNF Confirmation command for sending a ping Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC000001A R_E_REQUEST_RUNNING Request is already running 0xC0070100 R_E_IP_ERR_IP_ADDR_INVALID_IP_CMD_PING The IP address parameter ulIpAddr in command TCPIP_IP_CMD_PING_REQ is invalid This means the IP address ul IpAddr is equal to the TCP IP stacks own IP address 0xC0070120 R_E_IP_ERR_TIMEOUT_INVALID_IP_CMD_PING The timeout parameter ulTimeout in command TCPIP_IP_CMD_PING_REO is invalid 0xC0070300 R_E_IP_ERR_DEST_UNREACHABLE_IP_CMD_PING The target IP address ulIpAddr in command TCPIP_IP_CMD_PING_REO is not reachable 0xC0070310 R_E_IP_ERR_TIMEOUT_IP_CMD_PING The specified timeout ulTimeout in command TCPIP_IP_CMD_PING_REO has expired The specified host is not reachable 0xC00800C8 TLR_E_TCP_TASK_F_NOT_INITIALIZED Th
70. 2 ulTimeoutKeepAlive LR_UINT32 ulMulticastGroup HRGS ehMac aL Gra sic Ie IL IIR WINNIE RLRE E EE OOo iR OINA wulTos SErUOH LR_UINT8 bEnable ERENS qwigssitels LR UINT8 bPriority tVlanTag unParam f WEIDIND DANN CB IDI TE SOCK Ol ALIRONL UA Ir define TCPIP_DATA_TCP_UDP_CMD_SET_SOCK_OPTION_REQ_SIZE SIZEeo FE HECEITBEDATAETEBEUDDEENDESEIEESO CKEOPIETONEREIORTE typede T struct TCPIP_PACKET_TCP_UDP_CMD_SET_SOCK_OPTION_REO_Ttag TLR_PACKET_HEADER_T tHead WMCP Ne IDA IC UD2 EM SIT SOCK _ OR WILON INTO EDelear TCPIP_PACKET_TCP_UDP_CMD_SET_SOCK_OPTION_REQ T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 101 134 Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_SET_SOCK_OPTION_REQ_T Type Request Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 1 256 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to the socket handle ulSocket for request packet ulSrcld UINT32 0 2 1 Source
71. 20 ms 0xC0080045 R_E_TCP_ERR_INIT_OS_AND_TCPUDP_CYCLETIME The combination of configured operating system cycletime and TCP IP stacks cycletime startup parameter ulTcpCycleEvent is not possible The operating system cycletime must be smaller or equal than the TCP IP stacks cycletime 0xC0080070 TLR_E_TCP_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC0080074 R_E_TCP_ERR_OPTION_NOT_SUPPORTED_TCP_CMD_SEND The option parameter ulOptions in command TCPIP_TCP_CMD_SEND_REO is invalid 0xC0080075 R_E_TCP_ERR_PARAMETER_INVALID_TCP_UDP_CMD_SET_SOCK_OPTION The parameter in command TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REO is invalid 0xC0080078 R_E_TCP_ERR_CONN_CLOSED The connection has closed Graceful close 0xC0080079 R_E_TCP_ERR_CONN_RESET The connection has closed by reset Hard close 0xC008007A R_E_TCP_ERR_PROTOCOL_UNKNOWN_TCP_UDP_CMD_OPEN The protocol parameter ulProtocol in command TCPIP_TCP_UDP_CMD_OPEN_REO is invalid OxC008007B R_E_TCP_ERR_NO_SOCKETS_TCP_UDP_CMD_OPEN EQ There are no socket handles available TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Status error codes overview 127 134
72. 2015 The application interface 106 134 Hex Value Definition Description 0xC0080132 TLR_E_TCP_ERR_MODE_UNKNOWN_TCP_UDP_CMD_SET_SOCK_OPTION The mode parameter ulMode in command TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ is invalid Table 88 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Packet status error Source code example TLR_RESULT ApTcpUdpCmdSetSockOptionsCnf TCPIP_AP_TASK_RSC_T FAR TEPTPIPACKE LT TCP UDP CMD SET SOCK OFTION _CNEF TT REARS R_RESULT Rslt ptPck gt tHead ulSta IDEREPOOTBPACKEIIEREIEE SEI EDERS Gallo Cll TEI TE return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public DERSE PERCKED Hilscher 2005 2015 107 134 The application interface 6 2 15 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ CNF Obtaining socket options Specific information about an individual socket can be obtained from the TCP IP stack by sending a TCPIP_TCP_UDP_CMD_G Packet structure ET _SOCK_OPTION request command typedef struct TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_REQ_Ttag TLR_UINT32 ulMode TCPIP_DATA_TCP_UDP_CMD_GI He SOCK JOP ONERE define TCPIP_DATA_TCP_UDP_CMD_GE typedef struct TC TLR_PACKET_HE ANCE 112 HEI ICP
73. 2015 The application interface Packet description Structure TCPIP_PACKET_TCP_CMD_CONNECT_CNF_T 88 134 Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier untouched Handle of socket for the incoming connection ulSrcld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 8 TCPIP_DATA_TCP_CMD_CONNECT_CNF_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 73 TCPIP_TCP_CMD_CONNECT_CNF ulCmd UINT32 0x309 TCPIP_TCP_CMD_CONNECT_CNF Command ulExt UINT32 O Extension untouched ulRout UINT32 0 Routing do not touch Data Structure TCPIP_DATA_TCP_CMD_CONNECT_CNF_T ullpAddr UINT32 IP address of remote server ulPort UINT32 1 65535 Port number of remote server Table 72 TCPIP_TCP_CMD_CONNECT_CNF Confirmation command for establishing a TCP connection Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 LR_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 LR_E_INVALID_PACKET_LEN Packet length is invalid 0xC000001A LR_E_REQUEST_RUNNING
74. 32 ulTimeoutSend LReUINT Ss TRE EI TRAUINT Se TRET LR_UINT32 ulTimeoutInactive LR_UINT32 ulTimeoutKeepAlive EROUINTS2 ciMol ei east tris LR_UINT32 ulMulticastLoop ER UINT32 witos unParam TEPIP DATA TCP UDP CMD_GRT SOCK OPTION CNP Ts define TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_CNF_SIZE sizeof TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_CNF_T typeder struct TCPIP_ PACKET _TCP_UDP_CMD_GET_SOCK_OPTION_CNE_Ttag TLR_PACKET_HE ADER_T tHead WED le DATA INCI HEE Te Gat SOCK _ OW WON ICNP I ie DysnceiP TCPIP_PACKET_TCP_UDP_CMD_GET_SOCK_OPTION_CNE_T Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_GET_SOCK_OPTION_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier untouched ulSreld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 8 TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_CNF_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 94 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF ulCmd UINT32 0x311 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF Command ulExt UINT32 O Extensio
75. 383 reserved for Hilscher Netldent Protocol IP multicast receive always enabled from Ethernet Device Driver EDD TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Introduction 1 6 Terms abbreviations and definitions Term Description AP task Application task on top of the stack ARP Address Resolution Protocol BOOTP Bootstrap Protocol DHCP Dynamic Host Configuration Protocol EDD Ethernet Device Driver ICMP Internet Control Message Protocol IP Internet Protocol MAC Media Access Control address Ethernet address address MSS Maximum segment size of TCP data normally 1460 byte on Ethernet Maximum MSS MTU sizeof IP header sizeof TCP header 1500 20 20 1460 MTU Maximum Transmission Unit normally 1500 byte Data part of Ethernet frame TCP Transmission Control Protocol UDP User Datagram Protocol Table 3 Terms Abbreviations and Definitions All variables parameters and data used in this manual have the LSB MSB Intel data format This corresponds to the convention of the Microsoft C Compiler All IP 1 7 addresses in this document have host byte order References to documents This document refers to the following documents 1 2 Hilscher Gesellschaft fur Systemautomation mbH rcX Realtime Communication System for netX Kernel API Function Reference Re
76. 6 6 2 4 TCPIP_IP_CMD_GET_PARAM_REO CNF Obtaining IP parameters ee eee eee eee 49 6 2 5 TCPIP_IP_CMD_GET_OPTIONS_REO CNF Obtaining TCP IP stack capalbilities 56 6 2 6 TCPIP_IP_CMD_PING_REQ CNF Sending a Ing 60 6 2 7 TCPIP_TCP_UDP_CMD_OPEN_REQ CNF Opening a Socket sees 64 6 2 8 TCPIP_TCP_UDP_CMD_CLOSE_REQ CNF Closing a socket eee 70 6 2 9 TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ CNF Closing all sochketia eee 75 6 2 10 TCPIP_TCP_CMD_WAIT_CONNECT_REQ CNF Waiting for an Incoming TCP connection 80 6 2 11 TCPIP_TCP_CMD_CONNECT_REO CNF Establishing a TCP connection sees ee eee ee ee eee 85 6 2 12 TCPIP_TCP_CMD_SEND_REQ CNF Sending TCP dala 90 6 2 13 TCPIP_UDP_CMD_SEND_REQ CNF Sending UDP data sss sese 95 6 2 14 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ CNEF Setting socket options 100 6 2 15 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ CNF Obtaining socket options 107 6 2 16 TCPIP_TCP_UDP_CMD_RECEIVE_IND Receiving TCP data and UDP data 112 6 2 17 TCPIP_TCP_UDP_CMD_SHUTDOWN_IND RES Shutdown of the Stack sees eee 115 6 2 18 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Stop receiving of TCP data and UDP data 117 6 2 19 TCPIP_TCP_UDP_CMD_ACD_CONFLICT_IND Address conflict occurred sss sese 120 6 2 20 TCPIP_IP_CMD_ICMP_IND ICMP indication has been receved eee 122 Status error codes Overview vesse cesse cesse cesses rees eenn nenen nenen ennenen
77. 9 Released Public Hilscher 2005 2015 Appendix 133 134 8 2 List of figures Figure 1 TCP client example TCPIP_TCP_UDP_CMD_OPEN_REQ CNE ieeescessseeeeeeeeeeeeeeeeeseaeeseeeesaeeeseeessaeeseeeessaeeseeeenaas 12 Figure 2 TCP client example TCPIP_TCP_CMD_CONNECT_REQ CNF ssskisertttsttttttttttttttttttttnttttnnntAnnrE Ener EEEn EE nennen 13 Figure 3 TCP client example TCPIP_TCP_CMD_SEND_REQ CNF eee 13 Figure 4 TCP client example TCPIP_TCP_UDP_CMD_RECEILVE_IND ccsccceseseeeeeeneeeeeeeeeceseeeeeesnecesseseeeessuseeessneeeesaes 14 Figure 5 TCP client example TCPIP_TCP_UDP_CMD_CLOSE_REQ CNF eee 14 Figure 6 TCP server example TCPIP_TCP_UDP_CMD_OPEN_REQ CNE eee 15 Figure 7 TCP server example TCPIP_TCP_CMD_WAIT_CONNECT_REO eeeceeesseeeeeeeseeeeeeeseneeeeeeseeeeeaeeseeeeneeseneeeneeeeeaes 15 Figure 8 TCP server example TCPIP_TCP_CMD_WAIT_CONNECT_CNE eee 16 Figure 9 TCP server example TCPIP_TCP_UDP_CMD_RECEIVE_IND see 16 Figure 10 TCP server example TCPTp TGP CMD SEND REO CNRE nn 17 Figure 11 TCP server example TCPTp TGP Dp CMD CLOSE REO CNE nn 17 Figure 12 UDP communication example TCPIP_TCP_UDP_CMD_OPEN_REO CNE sees 18 Figure 13 UDP communication example TGP TP
78. ARAMETER_VERSION 2 parameter TCP IP stack version V2 0 12 0 special EIF version parameter KZ Ws E EIF Ethernet Interface WEP US WC _ WAS ESTER ale Ie VARY ee fe Se it Piz to INU SSS nore beloni Wis Z appended TCPIP_STARTUPPARAMETER_VERSION 3 parameter TCP IP stack version mre 0 SAP mcachcm a1 meoubmpatamcixcra N ny ys if KK ARP XXX TLR_UINT32 ulArpTimeoutCache ARP cache timeout seconds 27 Ws appended TCPIP_STARTUPPARAMETER_VERSION_5 parameter TCP IP stack version V2 0 16 0 netX hardware name e g used for NetIdent protocol ES z PPP MS harda renane Hr TLR_STR FAR pszHwNameNetX netX hardware name o s NULL or The internal hardware names are used et ff otherwise This hardware name is used netXXX Seeing danga 1 sa 63 eharacterg Append further starparameters here don t change the existing structure ie z TCPIP_TCP_TASK_STARTUPPARAMETER_T Note The startup parameter ptEif is only for Hilscher internal use Set it fix to NULL TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public 21 134 Hilscher 2005 2015 The startup parameters N _D 22 134 The range of the startup parameters is explained below _M EFAULT _MAx If there are no special requirements we suggest the use of the default startup parameters named with TCPIP_SRT_xx_DEFAULT Startup paramet
79. Addr Entry abEthernetAddr hernetAddr 0 1 f Hilscher 2005 2015 The application interface 6 2 5 The TCPI P _IP_CMD_GI TCPIP_IP_CMD_GET_OPTIONS_REQ CNF stack Capabilities supported protocols to the application Packet structure typedef struct TC ET_OPTI 56 134 Obtaining TCP IP ONS command instructs the IP layer to return information about PD BACKEN _ 12 MD GEHT OPTLONS_ NEO Wie exe TLR_PACKE T_HEAD ERS tHead TCPIP_PACKET_IP_CMD_GET_OPTIONS_REQ T Packet description Structure TCPIP_PACKET_IP_CMD_GET_OPTIONS_REQ_T Type Request Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for TCPIP_IP_xx packets ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 46 TCPIP_IP_CMD_GET_OPTIONS_REO ulCmd UINT32 0x208 TCPIP
80. BASE_ACCESS_FAILED Database access failure 0xC0000119 R_E_NOT_CONFIGURED Configuration not available Remark This is only a temporary error e g if no database access is configured flag TCPIP_SRT_FLAG_DBM of startup parameter ulStartFlags is not set 0xC0070034 R_E_IP_ERR_INIT_NO_ETHERNET_ADDR There is no Ethernet address MAC address available 0xC0070036 R_E_IP_ERR_INIT_INVALID_FLAG The start parameters contains one or more unknown flags 0xC0070037 R_E_IP_ERR_INIT_INVALID_IP_ADDR The start parameters contains an invalid IP address 0xC0070038 R_E_IP_ERR_INIT_INVALID_NETMASK The start parameters contains an invalid subnet mask 0xC0070039 R_E_IP_ERR_INIT_INVALID_GATEWAY The start parameters contains an invalid gateway IP address 0xC007003B R_E_IP_ERR_INIT_UNKNOWN_HARDWARE The device type is unknown 0xC007003C R_E_IP_ERR_INIT_NO_IP_ADDR Failed to obtain an IP address from the specified source s 0xC007003D R_E_IP_ERR_INIT_DRIVER_FAILED The initialization of the driver layer EDD is failed 0xC007003E R_E_IP_ERR_INIT_NO_IP_ADDR_CFG There is no source for an IP address BOOTP DHCP IP address parameter specified 0xC007007C LR_E_IP_ERR_ETH_ADDR_INVALID_IP_CMD_SET_PARAM The Ethernet address MAC address abEthernetAddr in command TCPIP_IP_CMD_SET_PARAM_REQ is invalid Invalid means abEthernetAddr is equal to the broadcast address FF FF FF FF FF FF 0xC0070083 LR_E_IP_ERR_ARP_CACHE_FULL_IP_CMD_SET_PARAM The c
81. CMD_GET_SOCK_OPTION_REQ_T ulMode UINT32 Mode Type of option See Table 90 TCP IP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ Parameter ulMode Table 89 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ Request command for obtaining socket options TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 108 134 Mode ulMode Description TCP_SOCK_TTL Get TTL value of outgoing IP packets 1 TCP_SOCK_SEND_TIMEOUT Get current send timeout 2 Applicable to TCP sockets only TCP_SOCK_PROTOCOL Get protocol type 3 TCP_SOCK_PORT Get port number 4 TCP_SOCK_INACTIVE_TIMEOUT Get inactivity timeout 5 Applicable to TCP sockets only TCP_SOCK_KEEPALIVE_TIMEOUT Get keep alive timeout 6 Applicable to TCP sockets only TCP_SOCK_MULTICAST_TTL Get TTL of multicast packets 9 Applicable to UDP sockets only TCP_SOCK_MULTICAST_LOOP Get loopback mode of outgoing multicast packets 10 Applicable to UDP sockets only TCP_SOCK_TOS Get TOS value of outgoing TCP and UDP packets 11 Table 90 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ Parameter ulMode Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 91 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REO Packet status error
82. CP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 40 134 The structure of the parameter data unParam union in the Packet structure depends on the Mode parameter ulMode Mode ulMode Description union element of ulLen unParam IP_PRM_ Add static entry to ARP tAddDelArpEntry TCPIP_DATA_ ADD_ARP_ENTRY cache IP_CMD_SET_PARAM_REQ_SIZE 1 ADD_ARP_ENTRY 14 IP_PRM_ Delete entry from ARP tAddDelArpEntry TCPIP_DATA_ DEL_ARP_ENTRY cache IP_CMD_SET_PARAM_REQ_SIZE 2 DEL_ARP_ENTRY 14 IP_PRM_ Delete entry from ARP tDelArpEntryIp TCPIP_DATA_ DEL_ARP_ENTRY_IP cache IP_CMD_SET_PARAM_REQ_SIZE 3 DEL_ARP_ENTRY_IP 8 IP_PRM_ Delete all entries with tDelArpEntryMac TCPIP_DATA_ DEL_ARP_ENTRY_MAC specified MAC address IP_CMD_SET_PARAM_REO_SIZE 4 from ARP cache DEL_ARP_ENTRY_MAC 10 IP_PRM_ Sends an ARP request tSendArpReq TCPIP_DATA_ SEND_ARP_REQ ARP send request IP_CMD_SET_PARAM_REQ_SIZ 5 interface SEND_ARP_REQ 14 IP_PRM_ Sends an ARP request tSendArpTmtReq TCPIP_DATA_ SEND_ARP_
83. CPIP_MAX_TCP_UDP_DATA_CNT TOPRMESPACKEDSROS AE INCI Ie LELE IL EIMIDI KEIM AED IT define TCPIP_DATA_IP_CMD_ICMP_IND_SIZE sizeof TCPIP_DATA_IP_CMD_ICMP_IND_T typeder struct TCPIP_PACKET_IP_CMD_ICMP_IND_Ttag TLR_PACKET_HEADER_T tHead TCPIP DATA IP CMD ICMP IND T tData y WC IPVNC IE Ie 102 EMI INOMIE IEINID AN TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description Structure TCPIP_PACKET_IP_CMD_ICMP_IND_T Type Indication 123 134 Variable Type Value Range Head Structure TLR_PACKET_HEADER_T Description ulDest UINT32 Destination queue handle of AP task process queue ulSrc UINT32 Source queue handle of TCP_UDP task process queue ulDestld UINT32 0 2 1 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process ulSrcld UINT32 1 256 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 n nis the Application data count of abData 1472 in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 0 Status Error ulCmd UINT32 0x20C TCPIP_IP_CMD_ICMP_IND Command ulExt UIN
84. CPIP_SRT_ARP_CACHE_SIZE_DEFAULT 64 joe Wentarwllic Sibictepessieaieia ee 4 per socket Depends on the host count Sf define TCPIP_SRT_ARP_CACHE_SIZE_MAX 512 Maximum 4 per socket max count 128 4 KK EDD XXX Min Default Max queue pool element count ulEddQuePoolElemCnt define TCPIP_SRT_EDD_OUE_POOL_ELEM_CNT_MIN 4 define TCPIP_SRT_EDD_QUE_POOL_ELEM_CNT_DEFAULT 32 define TCPIP_SRT_EDD_OUE_POOL_ELEM_CNT_MAX 1024 EET TEE TETE TE E count 128 8 Min Default Max count of maximum outgoing EDD buffers ulEddOutBufMaxCnt define TCPIP_SRT_EDD_OUT_BUF AX_CNT IN LH define TCPIP_SRT_EDD_OUT_BUE AX_CN DEFAULT 10 Pee Ace T ECE ILS z stacks instance is the only EDD user we can use all 20 buffers of EDD on netX but these buffers are used for data send and receiv so W L use per default only the half af Otherwise we must share the EDD buffers with other stack s of this instance 27 define TCPIP_SRT_EDD_OUT_BUF_MAX_CNT_MAX 20 Maximum buffer count of netX HAL EDD HIF Ethernet interface Remark These parameters are only for Hilscher internal use Hh pE ARP XXX Min Default Max of ARP cache timeout ulArpTimeoutCache in seconds S Remark found in www Dynamic ARP cache entries persist for 2 20 minutes eye 7 depending on the system ste los carefull vich too swall big valuss S TEETE SRT ARP TTIMTOUT CACHE DaPAULT is the svogescionl A de
85. Can EE be used simultaneous for TCP or UDP communication Every socket allocates sizeof tcp_Socket 2236 XI bytes The most space needs the receive buffer E abRecvBuf TCP_RECV_BUF_SIZE with 2048 bytes af Range TCPIP_SRT_SOCKET_MAX_CNT_MIN TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The startup parameters JER TCPIP_SRT_SOCKET_MAX_CNT_MAX 27 TLR_UINT32 ulArpCacheSize Number of entries in ARP cache must be et ff multiple of 16 ty Range TCPIP_SRT_ARP_CACHE_SIZE_MIN ny TCPIP_SRT_ARP_CACHE SIZE MAX KX EDD OK TLR_STR FAR pszEddName EDD name 2 TLR_UINT32 ulEddQuePoolElemCnt EDD Sizes of E queue for received EDD packets 27 fe and pe resource pool for received EDD packets G IS both must have the same size Range TCPIP_SRT_EDD_QUE_POOL_ELEM_CNT_MIN a TGPIP SRT EDD OUR POO ELEM IENTZMAR WIG URN ES ulEddOutBufMaxCnt Maximum count of outgoing EDD buffers E the TCP IP stack can use simultaneous Range TCPIP_SRT_EDD_OUT_BUF_MAX_CNT_MIN SE TCPIP_SRT_EDD_OUT_BUF_MAX_CNT_MAX Ws oy appended TCPIP_STARTUPP
86. D request command on this socket Using the connect timeout parameter a maximum time to wait for incoming connections can be given Usually the TCPIP_TCP_CMD_WAIT_CONNECT request command will not be confirmed immediately An immediate confirmation command will only be returned if invalid packet parameters are detected In the error free case the confirmation command will be deferred until a connection request comes in If the status field ulSta indicates no error a connection could be created and the socket is currently in established state In any other case no connection could be established and the socket is no longer listening Packet structure typedef struct TCPIP_DATA_TCP_CMD_WAIT_CONNECT_REO_Ttag LR_UINT32 ulTimeoutSend LR_UINT32 ulTimeoutListen TCPIP_DATA_TCP_CMD_WAIT_CONNECT_REO_T define TCPIP_DATA_TCP_CMD_WAIT_CONNECT_REQ_SIZE sizeof TCPIP_DATA_TCP_CMD_WAIT_CONNECT_REO_T typedef struct TCPIP_PACKET_TCP_CMD_WAIT_CONNECT_REO_Ttag TLR_PACKET_HEADER_T tHead INCPITDEDZSVANETEBECNDENZIENEECONNEEIHERE ORTE Daran TCPIP_PACKET_TCP_CMD_WAIT_CONNECT_REO_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 81 134 Packet description Struc
87. DP_CMD_CLOSE Command TCPIP_TCP_UDP_CMD_CLOSE_REQ The destination host network or port is unreachable 0xC0080302 TLR_E_TCP_ERR_DEST_UNREACHABLE_TCP_UDP_CMD_CLOSE_ALL Command TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ The destination host network or port is unreachable 0xC0080303 TLR_E_TCP_ERR_DEST_UNREACHABLE CP_CMD_WAIT_CONNECT Command TCPIP_TCP_CMD_WAIT_CONNECT_REQ The destination host network or port is unreachable 0xC0080304 TLR_E_TCP_ERR_DEST_UNREACHABLE_ CP_CMD_CONNECT Command TCPIP_TCP_CMD_CONNECT_REO The destination host network or port is unreachable 0xC0080305 R_E_TCP_ERR_DEST_UNREACHABLE_UDP_CMD_SEND Command TCPIP_UDP_CMD_SEND_REQ The destination host network or port is unreachable 0xC0070310 R_E_IP_ERR_TIMEOUT_IP_CMD_PING The specified timeout ulTimeout in command TCPIP_IP_CMD_PING_REO has expired The specified host is not reachable 0xC0080311 TLR_E_TCP_ERR_TIMEOUT_TCP_UDP_CMD_CLOSE The TCP Close timeout has expired A connection to the remote host could not be closed gracefully within this time For this timeout see command TCPIP_TCP_UDP_CMD_CLOSE_REO parameter ulTimeout
88. Description ullpAddr UINT32 IP address abEthernetAddr UINT8 6 Ethernet address MAC address ulStationCntAbort UINT32 Count of received stations when the command aborts 0 No station limit ulStationCnt UINT32 Count of founded stations with the given IP address tStation struct Station list MAC addresses of the received stations Table 31 TCPIP_IP_CMD_SET_PARAM_CNF Struct tSendArpTmt Cnf of union unParam Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC0000009 R_E_INVALID_PARAMETER Invalid Parameter in Packet found 0xC007007C R_E_IP_ERR_ETH_ADDR_INVALID_IP_CMD_SET_PARAM The Ethernet address MAC address abEthernetAddr in command TCPIP_IP_CMD_SET_PARAM_REQ is invalid Invalid means abEthernetAddr is equal to the broadcast address FF FF FF FF FF FF 0xC0070083 LR_E_IP_ERR_ARP_CACHE_FULL_IP_CMD_SET_PARAM The command TCPIP_IP_CMD_SET_PARAM_REO could not be executed because the ARP cache is full The ARP cache has per default configuration 64 entries 0xC0070086 TL
89. ECV_OPT_BROADCAST Broadcast flag 0x00000001 UDP broadcast telegram Table 96 TCPIP_TCP_UDP_CMD_RECEIVE_IND Receive options ulOptions TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 114 134 Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 97 TCPIP_TCP_UDP_CMD_RECEIVE_IND Packet status error Source code example TLR_RESULT ApTcpUdpCmdReceivelInd TCPIP_AP_TASK_RSC_T FAR ptRsc M212 IYNC IAA Cle WID2_ CMID IEEE E IND Res PETECE LR_RESULT Rslt ptPck gt tHead ulSta if ptPck gt tHead ulSrcId ptRsc gt tLoc ulSocket 7 Wace waceiwercl Cay ico REEE LIB_MEMCPY amp ptRsc gt tLoc abReceiveBuffer 0 TLR_UINT8 abReceiveBuffer TCPIP_MAX_TCP_UDP_DATA_CNT amp ptPck gt tData abData 0 ptPck gt tHead ulLen TCPIP_DATA_TCP_UDP_CMD_RECEIVE_IND_SIZE ptRsc gt tLoc uiReceiveBufferLen ptPck gt tHead ullen N TCPIP_DATA_TCP_UDP_CMD_RECEIVE_IND_SIZE else Wrong socket handle TLS_QUE_RETURNPACKET ptPck ILS_QUE_RETURNPACKET ptPck return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The ap
90. ESULT ApIpCmdSetConfigReq TCPIP_AP_TASK_RSC_T FAR ptRsc INC INS IEYNC IRIE Ale O MIB _ Sia CONMIGO sone Shs A ai WHR IPO INO Cis PEIN SCOC InPool PEPEK Wink SOK return TLR_E FAIL iS_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask 0 3 OUUNE IL IONIS Sab INCI SINC joeRelke PERS C 1c limlSiee s ptPck gt tHead ulLen TEPIP DATALTP CMD SET CONE IG REOUSIZEs ptPck gt tHead ulld STT TGT ERT ptPck gt tHead ulSta Op ptPck gt tHead ulCmd TCPIP_IP_CMD_SET_CONFIG_REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ulFlags IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NET_MASK IP_CFG_FLAG_GATEWAY ptPck gt tData ullpAddr LOCAL_IP_ADDR ptPck gt tData ulNetMask LOCAL_NET_MASK ptPck gt tData ulGateway LOCAL_GATEWAY if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask PrPekr ROO Ve AMIR ES LOKS i Rw e Olm2 AChE aR EEEEAS Pa uDielvs gt eigen ET IT TSTU WER mers Pie 1 Termend PAR O OK JP Packet structure oyp struct TCPIP_PACKET_IP_CMD_SET_CONFIG_CNF_Ttag TLR_PACKET_HEADER_T tHead TCPIP_PACKET_IP_CMD_SET_CONFIG_CNE_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 30 134 Packet description structure TCPIP_PACKET_IP_CMD_SET_CONFIG_CNF_T Type Confirmation Variable
91. ETHERNET pszEddName EDD name see atrXEdd ICIP WP SIR EF DD_QUE_POOL_ELEM _CNT_DEFAULT ulEddQuePoolElemCnt TCPIP _SRI_EDD_OUT_BUF_MAX CNT DEFAULT ulEddOutBufMaxCnt af NULL Dede see Fx TO IN TCP IP_SRT_ARP_TIMEOUT_CACHE_DEFAULT ulArpTimeoutCache NULL pszHwNameNetX S T TE etacie task bist 5 STATIC CONST FAR RX_STATIC TASK T FAR atrXStaticTasks Barc Did P Teeni irication E SE T R TILT E REE E l Wolesia IDS WSK RHEO Gi EE OF I RE meranese co 0 N NULL Pointer to Stack 7 TSK_STACK_SIZE_TCP_TASK Is Sizs Ot Task graci OF Threshold to maximum possible value Ef TLR_TASK_AUTO_START Start task automatically askEnter_TcpipTcpTask Task function to schedule z NUL Function called when Task will be deleted y UINT32 amp tTcpipTcpTaskParam Startup Parameter aif L 20720207 0 020 Reserved Region Ie TCP IP Packet Interface L DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 25 134 6 The application interface This chapter defines the application interface of the TCP IP stack The application itself has to be developed as a task according to the Hilscher s Task Layer Reference Model The application task is named AP task in the following sections and chapters The AP task s queue is used to send requests to the TCP IP stack to be processed After executio
92. FF bPriority Vlan Priority 0 7 Table 84 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Socket option data unParam Notes The TCP_SOCK_INACTIVE_TIMEOUT and the TCP_SOCK_KEEPALIVE_TIMEOUT option influence each other Only one can be active at a time Enabling one will automatically disable the other If either the inactivity timeout expires or the keep alive mechanism fails the connection will be closed automatically The stack will notify the application by sending a TCPIP_TCP_UDP_CMD_RECEIVE_STOP command containing an appropriate error code Please TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 103 134 refer to section TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Stop receiving of TCP data and UDP at page 117 for a description of the command The TCP_SOCK_TOS option should be used very careful because all values are allowed See RFCs 791 old meaning of this parameter 2474 DSCP and 3168 ECN The ECN bits are not supported from the TCP IP stack and should be set to zero at the moment Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 85 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REO Packet status error Source code example TER RESULT ApTcpUdpCmdSetSockOptionsReq TCPIP_AP_TASK_RSC_T FAR ptRsc WEIS INCE ICS UIDI2_CiMib _
93. G_FLAG_NET_MASK flag must be set in ulFlags Parameter ulGateway The ulGateway parameter stores the IP address of the default gateway Additionally the IP_CFG_FLAG_GATEWAY flag must be set in ulFlags Parameter abEthernetAddr The abEthernetAddr area can be used to overwrite the devices default Ethernet address MAC address Additionally the IP_CFG_FLAG_ETHERNET_ADDR flag must be set in ulFlags TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Start up of the TCP IP stack 11 134 3 Start up of the TCP IP stack After power on or reset the stack performs a start up initialization During this phase several steps are taken to bring the stack from uninitialized state to operation First the hardware will be self tested and the internal operating system will be started During the second step the initialization of the TCP IP stack will be completed Initially the TCP_UDP task will report an error code TLR_E_TCP_TASK_F_NOT_INITIALIZED diagnostic code TLR_DIAG_E_TCP_TASK_F_NOT_INITIALIZED which indicates that the task is still initializing This error diagnostic code will change to TLR_S_OK TLR_DIAG_STA_OK once the task has finished the initialization successfully In case of an initialization error an error diagnostic code which is different from TLR_E_TCP_TASK_F_NOT_INITIALIZED TLR_DIAG_E_TCP_TASK_F_NOT_INITIALIZED will be issu
94. IP configuration IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NET_MASK and IP_CFG_FLAG_GATEWAY are No flag set No manual configuration only DHCP and or BOOTP IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NET_MASK Local network without gateway IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NET_MASK IP_CFG_FLAG_GATEWAY Network with gateway TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Protocol parameters 10 134 Please note that there exists a fallback procedure between the different configuration methods if more than one is enabled in the ulFlags parameter If enabled the stack will first try to configure using DHCP If DHCP configuration fails the stack wills fallback to BOOTP if this is enabled In case of a BOOTP failure the values found in the ulIpAddr ulNetMask and ulGateway parameters will be used if enabled in ulFlags If none of these configuration mechanisms succeed the stack will report an error For a description of the timing implied by the different IP configuration mechanisms please refer to section Start up of the TCP IP at page 11 Parameter ulIpAddr The stacks IP address can be configured using the ulIpAddr parameter Additionally the IP_CFG_FLAG_IP_ADDR flag must be set in ulFlags Parameter ulNetMask The ulNetMask parameter holds the Netmask for the subnet the device is connected to Additionally the IP_CF
95. IP_PACKET_TCP_UDP_CMD_RECEIVE_STOP_IND_T Type Indication Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of AP task process queue ulSrc UINT32 Source queue handle of TCP_UDP task process queue ulDestld UINT32 0 2 1 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process ulSrcld UINT32 1 256 Source End Point Identifier specifying the origin of the packet inside the Source Process Socket handle ulSocket of the receiving socket ulLen UINT32 12 TCPIP_DATA_TCP_UDP_CMD_RECEIVE_STOP_IND_SIZE ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 102 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND ulCmd UINT32 0x316 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_UDP_CMD_RECEIVE_STOP_IND_T ullpAddr UINT32 Originating IP address ulPort UINT32 0 65535 Originating port Number ulOptions UINT32 Options of received data See Table 101 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Receive options ulOptions Table 100 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Indication command for stop
96. Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 78 134 Packet structure typeder Struct TCPIP_PACKET_TCP_UDP_CMD_CLOSE_All CNE_Trag TLR_PACKET_HEADER_T tHead TCPIP_PACKET_TCP_UDP_CMD CLOSE_ALL_CNF_T Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_CLOSE_ ALL CNE T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ludest UINT32 o Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 0 Destination End Point Identifier untouched ulSreld UINT32 0 2 1 Source End Point Identifier untouched lulen uINT32 lo Packet data length in bytes ud UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 65 TCPIP_TCP_UDP_CMD_CLOSE_ALL_CNF ulCmd UINT32 0x305 TCPIP_TCP_UDP_CMD_CLOSE_ALL_CNF Command ulExt UINT32 0 Extension untouched fulRout UINT32 lo Routing do not touch Table 64 TCPIP_TCP_UDP_CMD_CLOSE_ALL_CNF Confirmation command for closing all sockets TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet status error 79 134
97. MD_GET_SOCK_OPTION_CNF Packet status error uneesnnenerssnnnnenennnnnennnnnen ernennen ennnnr nn 110 Table 95 TCPIP_TCP_UDP_CMD_RECEIVE_IND Indication command for receiving TCP data and UDP data 113 Table 96 TCPIP_TCP_UDP_CMD_RECEIVE_IND Receive options ulOptions sese 113 Table 97 TCPIP_TCP_UDP_CMD_RECEIVE_IND Packet status error uensesnnnessnnnnennnnnnenennnnnnnnnnnnnnnnnnnen nennen ernennen 114 Table 98 TCPIP_TCP_UDP_CMD_SHUTDOWN_IND Indication command for shutdown of the stack nun eee ee 115 Table 99 TCPIP_TCP_UDP_CMD_SHUTDOWN_IND Packet status error uueesennnnnssnnnnnnnnnnnensnnnnnennnnnnnennnnnennnnnnnenennnnn nen 116 Table 100 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Indication command for stop receiving of TCP data and UDP data tun ei E AAA Seal ea A ht led ieee i SNe eR 118 Table 101 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Receive options ulOptions neeersennnensennnnenennnnen ernennen Table 102 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Packet status error sees eee eee eee eee Table 103 TCPIP_TCP_UDP_CMD_ACD_CONFLICT_IND Indication command for an address conflict Table 104 TCPIP_ARP_PACKET ARP pakotne r an aae ape aa oae Table 105 TCPIP_IP_CMD_ICMP_IND Indication command for ICMP Table 106 Status Error eee a TT a aa a raaa e E arrr a a Ea ea e aaa rE aa a e AE a a ee da e aeaa aeiaai TCP IP Packet Interface DOC05020 1API13EN Revision 13 English 2015 0
98. ONNECT_REQ is invalid or not available The parameter ulPort must be in range 1 65535 0xC0080124 LR_E_TCP_ERR_TIMEOUT_INVALID_TCP_CMD_CONNECT The timeout parameter ulTimeoutSend and or ulTimeoutConnect in command CPIP_TCP_CMD_CONNECT_REO is invalid 0xC0080201 LR_E_TCP_ERR_SOCKET_STATE_TCP_CMD_CONNECT The command TCPIP_TCP_CMD_CONNECT_REQ cannot be executed because the socket is in an inappropriate state 0xC0080304 TLR_E_TCP_ERR_DEST_UNREACHABLE_TCP_CMD_CONNECT Command TCPIP_TCP_CMD_CONNECT_REO The destination host network or port is unreachable 0xC0080314 LR_E_TCP_ERR_TIMEOUT_TCP_CMD_CONNEC The TCP Connect timeout has expired A connection to the specified remote host could not be established within this time For this timeout see command ECT_REO parameter ulTimeoutConnect Table 73 TCPIP_TCP_CMD_CONNECT_CNF Packet status error Source code example TLR RESULT AplepemadGonnecte ent ei ltr aA Dai hams CE FAR ptRsc SPAN VNC Ia AC CMID _ CLOUNININC IL CINNE _IE REIZE I ET LR_RESULT Rslt ptPck gt tHead ulSta if TLR_S_OK eRslt ptRsc gt tLoc ulRemotelpAddr ptRsc gt tLoc ulRemotePort TLR_POOL_PACKET_ R ELEASE ptRsc gt tLoc hPool ptPck return eRslt Ne TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public ptPck gt tData ullpAddr peek t Data ul DOSE 0 Hilscher 20
99. OO spt LC m e rerurn eT ERA R oA ih 4 POEURA WIR SOM p Packet structure Valid options of packet ulOptions variable define IP_OPT_PROTO_TCP 0x00000001 define IP_OPT_PROTO_UDP 0x00000002 define IP_OPT_BOOTP 0x00000004 define IP_OPT_DHCP 0x00000008 define IP_OPT_MULTICAS 0x00000010 typedef struct TCPTP_ DATA TP CMD GET OPTIONS_CNF Ttag TLR_UINT32 ulOptions O2 LDV 112 EHE OFT LONG SONES I define TCPIP_DATA_IP_CMD_GET_OPTIONS_CNF_SIZE T typedef struct TCPIP_PACKE TEEOCNDPECHIEORMION S ROCNE SNEG TLR_PACKET_HEADER_T IMEI ITH SET OPMLONS ENT _ tHead tData TCPIP_PACKET_IP_CMD_GET_OPTIONS_CNE_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public sizeof TCPIP_DATA_IP_CMD_GET_OPTIONS_CNF_T 57 134 Hilscher 2005 2015 The application interface Packet description 58 134 Structure TCPIP_PACKET_IP_CMD_GET_OPTIONS CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 0 Destination End Point Identifier untouched ulSrcld UINT32 10 275 1 Source End Point Identifier untouched ulLen UIN
100. P EN_R Hex Value Definition Description 0xC0080018 R_E_TCPIP_INVALID_STARTUP_PARAMETER_EIF_EDD_NAME Invalid Startup Parameter EIF pszEddName 0xC0080019 R_E_TCPIP_INVALID_STARTUP_PARAMETER_EIF_EDD_INSTANCE Invalid Startup Parameter EIF ulEddInstance 0xC008001A R_E_TCPIP_INVALID_STARTUP_PARAMETER_EIF_ETH_INTF_NAME Invalid Startup Parameter EIF pszEifEthInt f Name 0xC008001B R_E_TCPIP_INVALID_STARTUP_PARAMETER_EIF_MODE Invalid Startup Parameter EIF ulEifMode 0xC008001C R_E_TCPIP_INVALID_STARTUP_PARAMETER_EIF_PORT_RANGE Invalid Startup Parameter EIFs ulEifPortStart ulEifPortEnd 0xC008001D R_E_TCPIP_INVALID_STARTUP_PARAMETER_EIF_PORT_NMB Invalid Startup Parameter EIF ulEifPortNmk 0xC008001E R_E_TCPIP_INVALID_STARTUP_PARAMETER_ARP_TIMEOUT_CACHE Invalid Startup Parameter ulArpTimeoutCache 0xC008001F R_E_TCPIP_INVALID_STARTUP_PARAMETER_EIF_FLAGS Invalid Startup Parameter EIF ulEifFlags 0xC0080020L R_E_TCPIP_INVALID_STARTUP_PARAMETER_HW_NAME_NETX Invalid Startup Parameter pszHwNameNetx 0xC0080032 R_E_TCP_ERR_INIT_IP_TASK_NOT_READY The IP layer is not ready 0xC0080034 R_E_TCP_ERR_INIT_IP_TASK_FAILED The initialization of IP layer has failed 0x80080043 LR_W_TCP_ERR_INIT_TPIF_INIT_REQ_PCKT Warning A pending application packet has discarded because of a new application packet 0xC0080044 R_E_TCP_ERR_INIT_OS_CYCLETIME The configured operating system cycletime is out of range 0 1 ms
101. PACKET_TCP_CMD_CONNECT_REQ T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 86 134 Structure TCPIP_PACKET_TCP_CMD_CONNECT_REQ_T Type Request Variable Type Value Range Head Structure TLR_PACKET_HEADER_T Description ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 1 256 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to the socket handle ulSocket for request packet Handle of socket to connect to ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 16 TCPIP_DATA_TCP_CMD_CONNECT_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 71 TCPIP_TCP_CMD_CONNECT_REO ulCmd UINT32 0x308 TCPIP_TCP_CMD_CONNECT_REQ Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_CMD_CONNECT_REQ T ullpAddr UINT32 IP address of remote server to
102. P_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC0080075 R_E_TCP_ERR_PARAMETER_INVALID_TCP_UDP_CMD_SET_SOCK_OPTION The parameter in command TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ is invalid 0xC0080085 R_E_TCP_ERR_MAX_GROUP_EXCEEDED_TCP_UDP_CMD_SET_SOCK_OPTION Command TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ ulMode TCP_SOCK_ADD_MEMBERSHIP The maximum number of IP multicast groups has exceeded Default configuration 64 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080104 R_E_TCP_ERR_IP_ADDR_INVALID_TCP_UDP_CMD_SET_SOCK_OPTION The parameter ulMulticastGroup ulMode TCP_SOCK_ADD_MEMBERSHIP Or TCP_SOCK_DROP_MEMBERSHIP in command CPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REO is invalid The parameter ulMulticastGroup must be a valid Multicast address Valid Multicast addresses are 224 0 0 1 239 255 255 255 224 0 0 0 is reserved as Base multicast address 0xC0080125 TLR_E_TCP_ERR_TIMEOUT_INVALID_TCP_UDP_CMD_SET_SOCK_OPTION The timeout parameter ulTimeoutSend ulMode TCP_SOCK_SEND_TIMEOUT Or ulTimeout Inactive ulMode TCP_SOCK_INACTIVE_TIMEOUT or ulTimeoutKeepAlive ulMode TCP_SOCK_KEEPALIVE_TIMEOUT in command TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REO is invalid TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005
103. REQ cannot be executed because the socket is The command TCPIP_TCP_CMD_CONNECT_REQ cannot be executed because the socket is in an inappropriate state TLR_E TCP ERR_SOCK ET STATE TCP_CMD_SI The command TCPIP_TCP_CMD_SEN D_R inappropriate state TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public END EQ cannot be executed because the socket is in an Hilscher 2005 2015 EWAY Network with Status error codes overview 129 134 Hex Value Definition Description 0xC0080210 TLR_E_TCP_ERR_NO_FREE_QUEUE_ELEMENT_TCP_CMD_SEND The TCP send command TCPIP_TCP_CMD_SEND_REQ must be rejected because the list of free queue elements is empty Remark Per default configuration the initial size of this list is 128 Every send command TCPIP_TCP_CMD_SEND_REQ or TCPIP_UDP_CMD_SEND_REQ occupy one queue element until the confirmation command is given back to the application To avoid this resource problem the application must reduce the count of open send jobs over all sockets 0xC0080211 0xC0080212 TLR_E_TCP_ERR_NO_FREE_QUEUE_ELEMENT_UDP_CMD_SEND The UDP send command TCPIP_UDP_CMD_SEND_REQ must be rejected because the list of free queue elements is empty Remark Per d
104. R_E_IP_ERR_ARP_ENTRY_NOT_FOUND_IP_CMD_SET_PARAM The specified ARP entry in command TCPIP_IP_CMD_SET_PARAM_REQ could not be deleted The ARP entry was not found in ARP cache 0xC0070130 R_E_IP_ERR_MODE_UNKNOWN_IP_CMD_SET_PARAM The mode parameter ulMode in command TCPIP_IP_CMD_SET_PARAM_REO is invalid 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080213 R_E_TCP_ERR_NO_FREE_RESOURCE_FOR_ARP_REQ_INTF The command TCPIP_IP_CMD_SET_PARAM_REO in mode IP_PRM_SEND_ARP_REQ IP_PRM_SEND_ARP_TMT_REQ must be rejected because all free resources for this command are occupied A maximum of 128 parallel jobs is possible Table 32 TCPIP_IP_CMD_SET_PARAM_CNF Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 48 134 Source code example TLR_RESULT ApIpCmdSetParamCnf TCPIP_AP_TASK_RSC_T FAREED ERSE WMCP 2 SIR S LE KEIM SIE SEND GHH L RARO Ee TLR_RESULT Rslt ptPck gt tHead ulSta iE Ren Olm2 ACKER EEE SEI EBERSC gt EI CrlN II Caan pe return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 49 134 6 2 4 TCPIP_IP_CMD_GET_PARAM REQ CNF Obtaining IP parameters The TCPIP_IP_CMD_GET_PARAM command provides a method of ob
105. R_QUE_FREE CNT Invalid Startup Parameter ulQueFreeElemCnt 0xC0080012 R_E_TCPIP_INVALID_STARTUP_PARAMETER_TCP_CYCLE_EVENT Invalid Startup Parameter ulTcpCycleEvent 0xC0080014 R_E_TCPIP_INVALID_STARTUP_PARAMETER_QUE_ELEM_CNT_AP Invalid Startup Parameter ulQueElemCnt 0xC0080015 R_E_TCPIP_INVALID_STARTUP_PARAMETER_EDD_QUE_POOL_ELEM_CNT Invalid Startup Parameter ulEddQuePoolElemCnt 0xC0080016 R_E_TCPIP_INVALID_STARTUP_PARAMETER_START_FLAGS Invalid Startup Parameter ulStartFlags Unknown flags are set 0xC0080017 R_E_TCPIP_INVALID_STARTUP_PARAMETER_EDD_NAME Invalid Startup Parameter pszEddName TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Status error codes overview 126 134 Command TCPIP_TCP_UDP_CMD_O
106. Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 18 134 4 3 UDP communication example UDP is a very simple datagram oriented protocol layer which doesn t guarantee data to be delivered reliably The concept of a connection does not exist within UDP which leads to a simplified communication model compared to TCP As a result the number of commands that need to be exchanged between application and stack is reduced too The example shown below illustrates which commands need to be handled by an application that communicates using UDP 2 0 0 0 po e pope TCP_UDP_CMD_OPEN Request Command Socket TCP_UDP_CMD_OPEN Confirmation Command Device Figure 12 UDP communication example TCPIP_TCP_UDP_CMD_OPEN_REQ CNF Most simply only a UDP socket needs to be opened in order to enable an application to receive UDP data The application sends a TCPIP_TCP_UDP_CMD_OPEN request command to the stack and waits for the corresponding confirmation command to be returned D Data Socket De gt TCP_UDP_CMD_RECEI VE Request Command a RIS TCP_UDP_CNMD_RECEI VE Request Command Device
107. Sis SOCK OL WON INO eek SLi WWI JOO WYN Cie FOES Sc OC Ineo Kjeriwel lt e l Wink SOK return TLR_E FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask ptRsc gt tLoc ulSocket SEO U EBEN I Sat RYN SINC T E TE TE PeBek eHeaernlmenss Ei PITBEDIEANETGSBEUDBEEMDESEIRESOCKZOEITTONEREORSIEZE ptPck gt tHead ulld PERS C e EPOCA NCEP ied ptPck gt tHead ulSta 0 jewel Scleleerel wulCmel R TEE WC __ IDI2 CMID _ Sit SHOW _Oyer IE ILO ET ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ulMode TCP_SOCK_SEND_TIMEOUT ptPck gt tData unParam ulTimeoutSend 10000 Se MO gc ef if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask joe Pele 1 00 eS AMIR SON WG JOO IACI INGLES CISC Ee rO CrN PEOC EPER CKE return TLRUE PAIL ee wei Win S_OK 8 TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet structure 104 134 Gypedez Struct TCPIP_DATA TCP _UDP_CMD SET _SOCK_OPTION_CNE Ttag TLR_UINT32 WC Ie IDEE ulMode UDPECMDESETESO Kn Eels Nas H define TCPIP_DATA_TCP_UDP_CMD_SET_SOCK
108. T32 4 TCPIP_DATA_IP_CMD_GET_OPTIONS_CNF_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 49 TCPIP_IP_CMD_GET_OPTIONS_CNF ulCmd UINT32 0x209 TCPIP_IP_CMD_GET_OPTIONS_CNF Command ulExt UINT32 O Extension untouched ulRout UINT32 0 Routing do not touch Data Structure TCPIP DATA 1P CMD GET OPTIONS _CNF_T ulOptions UINT32 Options supported by TCP IP stack See Table 48 TCPIP_IP_CMD_GET_OPTIONS_CNF Supported options ulOptions Table 47 TCPIP_IP_CMD_GET_OPTIONS_CNF Confirmation command for obtaining TCP IP stack capabilities The ulOptions parameter holds the option data in a bit oriented format Bits Name Bit mask Description 31 5 Reserved Reserved for future use 4 IP_OPT_MULTICAST IP Multicast supported 0x00000010 3 IP_OPT_DHCP DHCP supported 0x00000008 2 IP_OPT_BOOTP BOOTP supported 0x00000004 1 IP_OPT_PROTO_UDP UDP supported 0x00000002 0 IP_OPT_PROTO_TCP TCP supported 0x00000001 Table 48 TCPIP_IP_CMD_GET_OPTIONS_CNF Supported options ulOptions TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 59 134 Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Com
109. T32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_IP_CMD_ICMP_IND_T bType UINT8 ICMP Type field bCode UINT8 further specification of the ICMP type usChecksum UINT16 This field contains error checking data calculated from the ICMP header data abData UINT8 Data of the ICMP request Table 105 TCPIP_IP_CMD_ICMP_IND Indication command for ICMP TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Status error codes overview 7 Status error codes overview Packet status error 124 134 Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC0000009 R_E_INVALID_PARAMETER Invalid Parameter in Packet found 0xC000001A R_E_REQUEST_RUNNING Request is already running 0xC0000101 R_E_DATA
110. TA_TCP_UDP_CMD_OPEN_CNF_S typedef struct TC SID E HE CDU sizeof TCPIP za N DATA_TCP_UDP_CMD_OP EN_CNF_T DP_CMD_OPEN_CNF_Ttag T EIER INES Il EAD ERS TCDD DATA IE CE UDP_CMD_OPEN_CNF_T thes tDat TCPIP_PACKET_TCP_UDP_CMD_OPEN_CNE_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public d a 67 134 2 27 ey E Hilscher 2005 2015 The application interface Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_OPEN_CNF_T 68 134 Type Confirmation Variable Type Value Range Head Structure TLR_PACKET_HEADER_T Description ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier socket handle u Socket ulSrcld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 12 TCPIP_DATA_TCP_UDP_CMD_OPEN_CNF_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 57 TCPIP_TCP_UDP_CMD_OPEN_CNF ulCmd UINT32 0x301 TCPIP_TCP_UDP_CMD_OPEN_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 0 Routing do not touch Data Structure TCPIP_DATA_TCP_UDP_CMD_OPEN_CNF_T ullpAddr UINT32 Local IP ad
111. TCPIP_IP_CMD_GET_PARAM_CNF Struct tArpEnt ry Of UNION WnParan sese eee eee eee Table 44 TCPIP_IP_CMD_GET_PARAM_CNF Packet status error sese eee eee eee Table 45 TCPIP_IP_CMD_GET_OPTIONS_REQ Request command for obtaining TCP IP stack capabilities 56 Table 46 TCPIP_IP_CMD_GET_OPTIONS_REQ Packet StatuS rror eee e eee eee eee 56 Table 47 TCPIP_IP_CMD_GET_OPTIONS_CNF Confirmation command for obtaining TCP IP stack capabilities 58 Table 48 TCPIP_IP_CMD_GET_OPTIONS_CNF Supported options ULOPtCions sese Table 49 TCPIP_IP_CMD_GET_OPTIONS_CNF Packet status error ece Table 50 TCPIP_IP_CMD_PING_REQ Request command for sending a ping Table 51 TCPIP_IP_CMD_PING_REQ Packet status error unnesssnenensennnnensnnnnnnnnnnnen nenn Table 52 TCPIP_IP_CMD_PING_CNF Confirmation command for sending a ping sss sees eee eee Table 53 TCPIP_IP_CMD_PING_CNF Packet status error nuneessnenensennnnensnnnnnnnennnnn nennen ennnnnnnennnernennnnenernnnnrnnnnnernrnnen Table 54 TCPIP_TCP_UDP_CMD_OPEN_REQ Request command for opening a SOCKET sese eee eee eee eee Table 55 TCPIP_TCP_UDP_CMD_OPEN_REO Packet status error unzennnnnsnnnnennennnnnennnnnnnennnnnnnennnennennnnnnennnennnennnenn nenn Table 56 TCPIP_TCP_UDP_CMD_OPEN_CNF Confirmation command for opening a socket Table 57 TCPIP_TCP_UDP_CMD_OPEN_CNF Packet status error uneennnensnnnnennennnnnnennnnnnennnnnnnennnenn
112. TCPIP_TCP_UDP_CMD_CLOSE confirmation command is returned to the application TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 15 134 4 2 TCP server example The example shown in this section shall demonstrate the operation of a very simple TCP server application The server waits for an incoming request from the network When the request is received some response data is sent as a reply and the connection is closed upon completion o pa Po oe er TCP_UDP_CMD_OPEN Request Command Socket TCP_UDP_CMD_OPEN Confirmation Command Device Figure 6 TCP server example TCPIP_TCP_UDP_CMD_OPEN_REQ CNF A socket must be opened before any TCP communication on the network can start The server application sends a TCPIP_TCP_UDP_CMD_OPEN request command to the stack and waits for the corresponding confirmation command which returns a socket handle dew ae TGP CMD WA T_CONNECT Request Command Socket Device Figure 7 TCP server example TCPIP_TCP_CMD_WAIT_CONNECT_REQ When a socket handle can be obtained the
113. TE uildx if TLR POOL PACKET GET ptRsce gt tTLoce hPool amp ptPck return TLR_E_FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask ptRsc gt tLoc ulSocket SEO U EBEERINIKSESENBEDNEREINES Rei E ekrEpeRsc_ ITE TE ptPck gt tHead ulLen TCPIP_DATA_UDP_CMD_SEND_REQ SIZE uiSendLen ptPck gt tHead ulld AVE RSE Sie LOE WL Sinvchitieyo Cl ptPck gt tHead ulSta Op ptPck gt tHead ulCmd TCPIP_UDP_CMD_SEND_REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 ptPck gt tData ullpAddr REMOTE_IP_ADDR PULRCEK gt LDarla ulPForE REMOTE_PORT ptPck gt tData ulOptions 0 BO wireh Os ulldx lt uiSendLen 106 Data index TLR_S_OK Ger iP SPACKH a UDP CMDEES HN Dm RH Oma if TLS_QUE un ENDPACK ERC 100 TLR_POOL_PACKET_R EHRE SE PERS S EDGE E SS OL return TER D PATE Poruni OEREO SOKE TCP IP Packet Interface wai rose ptPck gt tData ptPck abData uildx IP address of remote host 192 188 10 TCP UDP port of remote host 97 134 ey E Set test data also without def ptRsc gt tLoc bTestSndData ET_FIFO ptRsc gt tRem tQueTcpTask ye AIRS S O i DOC050201API13EN Revision 13 English 2015 09
114. TMT_REQ ARP send request IP_CMD_SET_PARAM SIZE 6 interface Searches for SEND_ARP_TMT_REQ more stations 18 IP_PRM_ Set timeout for ARP tSetArpReqTmt TCPIP_DATA_ SET_ARP_REO_TMT requests global value IP_CMD_SET_PARAM SIZE 7 for every ARP request SET_ARP_REO_TMT 8 IP_PRM_ Register Application for No element TCPIP_DATA_ REGISTER_ACD_APP ACD conflict indications necessary IP_CMD_SET_PARAM SIZE 8 REGISTER_ACD_APP 4 IP_PRM_ Register application for tRegisterIcmp TCPIP_DATA_ REGISTER_ICMP_APP ICMP service Service LP EIR SET JP ARAM RE SIZE 9 REGISTER_ICMP_APP 8 Table 17 TCPIP_IP_CMD_SET_PARAM_REQ Mode description for parameter data unParam The allocated packet size must consider the maximum used packet data length ulLen by memory allocation This must be considered also for the confirmation packet see Table 28 TCPIP_IP_CMD_SET_PAI The following tables TCP IP Packet Interface table describes the DOC050201API13EN Revision 13 English 2015 09 Released Public union unParam TCPIP_DATA_IP_CMD_SET_PARAM_REQ_T The union elements are described in the following RAM_CNF Mode Description for Parameter Data unParam in structure Hilscher 2005 2015 The application interface 41 134 Union unParam Variable Type Value Range Description tAddDelArpEntry struct Request structure for both Add static entry t
115. TTL value of multicast packets UINT32 1 255 9 TCP_SOCK_MULTICAST_LOOP Loopback mode of outgoing UINT32 Q 1 10 multicast packets 0 Loopback inactive TCP_SOCK_TOS TOS value of outgoing TCP and UINT32 Q 255 11 UDP packets Table 93 TCPIP Packet status error TCP_UDP_CMD_GET_SOCK_OPTION_CNF Socket option data unParam Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC0080070 R_E_TCP_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080133 R_E_TCP_ERR_MODE_UNKNOWN_TCP_UDP_CMD_GET_SOCK_OPTION The mode parameter ulMode in command TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REOIS invalid Table 94 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 111 134 Source code example TLR RESULT ApTcpUdpCmdGetSockOptionsCnf TCPIP_AP_TASK_RSC_T FAR ptRsc WEP INS EA S ACI
116. TcphdlPckt c 0xC0080140 R_E_TCP ERR_MAX_DATA_LEN EXCE The maximum TCP data count nin command TCPIP_TCP_C parameter ulLen The maximum value for nis TCPIP_MAX EDED_CP_CMD_SEND D_SEND_R EQ has exceeded See CP_DA A_CNT 1460 0xC0080141 TLR_E TCP ERR_MAX_DATA_LEN EXCE EDED_UDP_CMD_SEND The maximum UDP data count nin command TCPIP_UDP_C D_SEND_REQ has exceeded See parameter ulLen The maximum value for nis TCPIP_MAX_UDP_DATA_CNT 1472 0xC0070150 0xC0080200 0xC0080201 0xC0080202 TLR_E IP ERR_INIT_INVALID_FLAGS_IP_CONFIG The start parameters configures an invalid flag combination for the manual IP configuration IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NI Valid flag combinations are No flag set No manual configuration only DHCP and or BOOTP MASK Local network without gateway IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NE IP_CFG_FLAG_IP_ADDR IP_CFG_FLAG_NE gateway MASK IP_CFG_FLAG_GATI TLR_E TCP ERR_SOCK ET_STATE TCP_CMD_WAIT_CONNECT The command TCPIP_TCP_CMD_WAIT_CONN in an inappropriate state TLR_E TCP ERR_SOCK ET_STATE TCP_CMD_CONNECT ET_MASK IP_CFG_FLAG_GATEWAY ECT_
117. _IP_CMD_GET_OPTIONS_REQ Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Table 45 TCPIP_IP_CMD_GET_OPTIONS_REO Request command for obtaining TCP IP stack capabilities Packet status error Hex Value 0x00000000 TLR_S_OK Status ok Definition Description Table 46 TCPIP_IP_CMD_GET_OPTIONS_REO Packet status error TCP IP Pack DOC050201API13EN Revision 13 English 2015 09 Released Public et Interface Hilscher 2005 2015 The application interface Source code example TLR_RESULT ApIpCmdGetOptionsReq TCPIP_AP_TASK_RSC_T FAR ptRsc WEP We S ST 2 IE ST OS FARO INGO ee if TER POOL PACKET GET ptRsc gt tLoc hPool amp ptPek TLR S_OK return TLR_E FAIL iS_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask 0 ROULMENK mori mE ACK GS RC EP EPeERT PERS C erocheinkszes r ptPck gt tHead ulLen 0 ptPck gt tHead ulld CRS C TELOS IRIS GHG TSE T ptPck gt tHead ulSta 03 ptPck gt tHead ulCmd TCPIP_IP_CMD_GET_OPTIONS_REO ptPck gt tHead ulExst 0 ptPck gt tHead ulRout 0 if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask BERCK 100 TLR_S_OK Pine OLPACKH SRE LEASH piss C H L
118. _OPTION_CNF_SIZE eOr IC EITBEDIUTNEETEBEUDDRENDESEIEES CKEOPAHETONMENHERTE E Bypedem ss e EUC IWC We RE SIT HEE DIDI S ETRE ST SETS GE ELOI TOR ANAG TLR_PACKET_HEADER_T tHead TEIR S LIS DE UDERECMDESTUBESOEC ROOPTTION ENF AT Data TCPIP_PACKET_TCP_UDP_CMD_SET_SOCK_OPTION_CNF_T Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_SET_SOCK_OPTION_CNF_T Type Confirmation Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle untouched ulSrc UINT32 Source queue handle untouched ulDestld UINT32 1 256 Destination End Point Identifier untouched ulSreld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 4 TCPIP_DATA_TCP_UDP_CMD_SET_SOCK_OPTION_CNF_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 88 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF ulCmd UINT32 Ox30F TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 0 Routing do not touch Data Structure TCPIP_DATA_TCP_UDP_CMD_SET_SOCK_OPTION_CNF_T ulMode UINT32 Mode Type of option See Table 87 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Parameter ulMode Table 86 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Confirmation command for setting socket optio
119. _PACKET_TCP_UDP_CMD CLOSE REQ T Type Request 71 134 Variable Type Value Range Head Structure TLR_PACKET_HEADER_T Description ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 1 256 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to the socket handle ulSocket for request packet Socket handle to close ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 TCPIP_DATA_TCP_UDP_CMD_CLOSE_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 59 TCPIP_TCP_UDP_CMD_CLOSE_REQ ulCmd UINT32 0x302 TCPIP_TCP_UDP_CMD_CLOSE_REQ Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 O Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_UDP_CMD_ CLOSE REQ T ulTimeout UINT32 0 1 24 OxFFFFFFFF Close timeout Default timeout 13000 milliseconds Wait up to specified time for completion of the close operation graceful close if timeout is exceeded perform connection reset timeout in milliseconds Applicabl
120. _UDP_CMD_OPEN_REO_SIZE sezcor CDE a DATDAm Le PUD Pm CMDmOP HNMR RH R I typedef struct TCPIP_PACKET_TCP_UDP_CMD_OPEN_REQ_Ttag TLR_PACKET_HEADER_T tHead TCPIP_ DATA _TCP_UDP_CMD_OPEN_REQ T tData TCPIP_PACKET_TCP_UDP_CMD_OPEN_REQ T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 66 134 Structure TCPIP_PACKET_TCP_UDP_CMD_OPEN_REQ T Type Request Variable Type Value Range Head Structure TLR_PACKET_HEADER_T Description ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for request packet ulSreld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 12 TCPIP_DATA_TCP_UDP_CMD_OPEN_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 55 TCPIP_TCP_UDP_CMD_OPEN_REO ulCmd UINT32 0x300 TCPIP_TCP_UDP_CMD_OPEN_REQ Command ulExt UINT32 0 Extensio
121. _W_CACHEENTRY and IP_PRM_SET_ARP_REQ_TMT See the following description ARP send request interface The motivation for mode IP_PRM_SEND_ARP_REO is to send an ARP request for checking for an existing IP address on the network Up to 128 simultaneously active ARP requests are possible The timeout for every ARP request is 1 second by default and can be changed by mode IP_PRM_SET_ARP_REQ_TMT If the checked IP address remote station exists the confirmation packets delivers the error code TLR_S_OK otherwise the confirmation packets delivers the error code TLR_E_FAIL after the timeout For the request packet struct t SendArpReq Parameter ul IpAddr is the IP address to check If parameter abEthernetAdadr is set to zero 0x00 0x00 0x00 0x00 0x00 0x00 a broadcast ARP request is send otherwise an unicast ARP request to the given MAC address is sent For the confirmation packet struct t SendArpCnf Parameter ul IpAddr is unchanged Parameter abEthernetAdadr is set to the MAC address of the checked remote station if the station exists ulSta TLR_S_OK Otherwise the parameter abEthernetAdadr is set to zero ulSta TLR_E_FAIL The motivation for mode IP_PRM_SEND_ARP_TMT_REQ is in principle the same as for mode IP_PRM_SEND_ARP_REQ but this mode can search for more stations with the given IP address Up to 128 simultaneously activ
122. a hilscher COMPETENCE IN COMMUNICATION Protocol API TCP IP Packet Interface V2 2 Hilscher Gesellschaft fur Systemautomation mbH www hilscher com DOC050201API13EN Revision 13 English 2015 09 Released Public Introduction 2 134 Table of Contents 1 Introduction a T O A 3 1 7 About this doe ment sin Hase ren capesneddddesacechesdeeacebinendapeets 3 VD Ai LISEIOR REVISIONS z u ee ae ba ecu teen ees ve da ee ec ial ccd gels Runa ecxeg evs O ENS 3 1 2 RunctionaloVervieW nes sce tude a a ant iecacen TTT 4 1 3 System requirements seer eee eee eee eee eee eee eee 4 t4 INTENGEG AU CIE NCS TTT 4 WSS eSpecificationS eis snara aa ea a E A T 5 1 51 Supported Protocol TE 5 W522 gt hechnlCal Gates ii e e aar Ee e ae a oe e e ie a e Eae a E eSEE 5 1 5 3 Limitations siten e eee HIT ed ete see 5 1 6 Terms abbreviations and definitions sees eee ee eee 6 1 7 References to documenter eee eee 6 1 8 Legal neS eaa sews ced ta hed enya caches ist ken hs Header lated pada casban hapa taeda ese 7 18 1 Gopyright 2un2 2 3 a a et oe tet ae dda 7 1 8 2 Important Notes itai ea a E r A R 7 1 8 3 Excl si m ot lability 4 eae TTT 8 E 2 EXDOM EEE T E ddcesk sung e
123. able Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT3 Destination queue handle untouched 2 ulSrc UINT3 Source queue handle untouched 2 ulDestld UINT3 0 Destination End Point Identifier untouched 2 ulSrcld UINT3 0 2 1 Source End Point Identifier untouched 2 ulLen UINT3 22 TCPIP_DATA_IP_CMD_GET_CONFIG_CNF_SIZE Packet data 2 length in bytes ulld UINT3 0 2 1 Packet identification untouched 2 ulSta UINT3 See Table 15 TCPIP_IP_CMD_GET_CONFIG_CNF 2 ulCmd UINT3 0x203 TCPIP_IP_CMD_GET_CONFIG_CNF Command 2 ulExt UINT3 0 Extension untouched 2 ulRout UINT3 0 Routing do not touch 2 Data Structure TCPIP_DATA_IP_CMD_GET_CONFIG_CNF_T ulFlags UINT32 Flags See chapter Description of the protocol at page 9 ullpAddr UINT32 IP address of the stack ulNetMask UINT32 Netmask of local subnet ulGateway UINT32 IP address of default gateway abEthernetAddr 6 UINT8 Ethernet address MAC address of the device Table 14 TCPIP_IP_CMD_GET_CONFIG_CNF Confirmation command for obtaining configuration data Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 LR_E_INVALID_PACKET_LEN Packet length is invalid 0xC00800C8 LR_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized
124. ack in a more efficient way The stack starts to send the accumulated data as soon as a full size TCP segment can be assembled The stack sends the data immediately if the push flag TCP_SEND_OPT_PUSH in the options field ulOptions is set Packet structure Options of packet ulOptions variable define TCP_SEND_OPT_PUSH 0x00000001 typedef struct TCPIP_DATA_TCP_CMD_SEND_REO_Ttag LR_UINT32 ulOptions LR_UINT8 abData TCPIP_MAX_TCP_DATA_CNT TCEPTP DATA _TCP_CMD_SEND_REQO_T define TCPIP_DATA_TCP_CMD_SEND_REQ_SIZE sizeof TCPIP_DATA_TCP_CMD_SEND_REO_T ICP 112 IMB ICIP DATA CINE typedef struct TCPIP_PACKET_TCP_CMD_SEND_REO_Ttag TLR_PACKET_HEADER_T tHead TCPIP DATA TCP_CMD_SEND_REQ T tData TCPIP_PACKET_TCP_CMD_SEND_REO_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 91 134 Structure TCPIP_PACKET_TCP_CMD_SEND REQ T Type Request Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source
125. am Additional data required by parameter See Table 34 TCPIP_IP_CMD_GET_PARAM_REQ Mode description for parameter data unParam and the following tables Table 33 TCPIP_IP_CMD_GET_PARAM_REQ Request command for obtaining IP parameters TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 51 134 The structure of parameter request data unParam union in the Packet structure depends on the Mode parameter ulMode Mode ulMode Description union element of ulLen unParam IP_PRM_GET_ Get ARP entry at specified tArpEntryIndex TCPIP_DATA_ ARP_ENTRY_INDEX cache index IP_CMD_GET_PARAM_REO_SIZE 1 GET_ARP_ENTRY_INDEX 8 IP_PRM_GET_ Get entry with specified IP tArpEntryIp TCPIP_DATA_ ARP_ENTRY_IP address from ARP cache IP_CMD_GET_PARAM_REOQO_SIZE 2 GET_ARP_ENTRY_IP 8 IP_PRM_GET_ Get first entry with specified tArpEntryMac TCPIP_DATA_ ARP_ENTRY_MAC MAC address from ARP TIE CMD GRT PARAM REQ SIZE 3 cache GET_ARP_ENTRY_MAC 10 Table 34 TCPIP_IP_CMD_GET_PARAM_REQ Mode description for parameter data unParam The allocated packet size must consider the maximum used packet data length ulLen by memory allocation The following table describes the union unParam in struct
126. ation interface 44 134 Packet structure typedef struct TCPIP_DATA_IP_CMD_SET_PARAM_CNF_Ttag TLR_UINT32 ulMode union Sure LR_UINT32 ulIpAddr LR_UINT8 abEthernetAddr 6 tSendArpCnf SEEUOT LR_UINT32 ulIpAddr fe erruct Recqussic LR_UINT8 abEthernetAddr 6 N WR WUNUS2 wihSiceicilemGaicNoomes SM ERSUTNTO 2 IT HI 9 Count of founded stations MAC_ADDR_T tStation SEND_ARP_TMT_STATION_MAX Station list tSendArpTmtCnf unParam CD le IDAMA Ile MID Sia PVA CIN define TCPIP_DATA_IP_CMD_SET_PARAM_CNF_SIZE 2 sizeof TLR_UINT32 define TCPIP_DATA_IP_CMD_SET_PARAM_CNF_SIZE_SEND_ARP_REO sizeof TLR_UINT32 10 sizeof tSendArpCnf HT define TCPIP_DATA_IP_CMD_SET_ PARAM CNF_SIZE_SEND_ARP_T REQ_MIN sizeof TLR_UINT32 18 sizeof tSendArpTmtcnf typedef struct TCPIP_PACKET_IP_CMD_SET_PARA Q opted TLR_PACKET_HEADER_T tHead TCPIP DATA IP CMD SET PARAM CNE T tData TCPIP_PACKET_IP_CMD_SET_PARAM_CNE_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Packet description 45 134
127. ation partner The error code TLR_E_TCP_ERR_DEST_UNREACHABLE_UDP_CMD_SEND Destination is T unreachable is returned if the previous UDP send command was targeted to the same destination as the current one and a destination unreachable notification was received So the Status field ulSta indicates an error from the previous send command in this case However the data from the current UDP send command have been transmitted on the line despite of this error Source code example TLR_RESULT ApUdpCmdSendCnf 17 HOSTIS IND WAS INSET FAR ptRsc TCPIP_PACKET_UDP_CMD_SEND_CNF_T FAR ptPck R_RESULT RS lt ptPck gt tHead ulSta it return eRslt TCP IP Packet Interface TLR_POOL_PACKE Ne EA EIS SC SIRS C LOC INZCGOl EE ECKEN DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 100 134 6 2 14 TCPIP_TCP_UDP_CMD SET _SOCK_OPTION_REQ CNF Setting socket options Socket specific parameters can be provided for each socket by sending a TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION command to the TCP IP stack Packet structure typedef struct TCPIP_DATA_TCP_UDP_CMD_SET_SOCK_OPTION_REQ_Ttag TLR_UINT32 ulMode union Tees SE bel se LR_UINT32 ulTimeoutSend LR_UINT32 ulTimeoutInactive LR_UINT3
128. close 0xC00800C8 LR_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080123 LR_E_TCP_ERR_TIMEOUT_INVALID_TCP_CMD_WAIT_CONNECT The timeout parameter ulTimeoutSend and or ulTimeoutListen in command CPIP_TCP_CMD_WAIT_CONNECT_REO is invalid 0xC0080200 LR_E_TCP_ERR_SOCKET_STATE_TCP_CMD_WAIT_CONNECT The command TCPIP_TCP_CMD_WAIT_CONNECT_REO cannot be executed because the socket is in an inappropriate state TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 84 134 Hex Value Definition Description 0xC0080303 TLR_E_TCP_ERR_DEST_UNREACHABLE_TCP_CMD_WAIT_CONNECT Command TCPIP_TCP_CMD_WAIT_CONNECT_REQ The destination host network or port is unreachable 0xC0080313 TLR_E_TCP_ERR_TIMEOUT_TCP_CMD_WAIT_CONNECT The TCP Connect timeout has expired No remote host has connected within this time For this timeout see command TCPIP_TCP_CMD_WAIT_CONNECT_REQ parameter ulTimeoutListen Table 69 TCPIP_TCP_CMD_WAIT_CONNECT_CNF Packet status error Source code example TER RESULT ApTcpCmdWaitConnectCnf TCPIP_AP_TASK_RSC_T INR DERS O INCI YAOI TECE TIE _ iAP e TR e TT T LR_RESULT Rslt ptPck gt tHead ulSta if TLR_S_OK eRslt ptPck gt tData ullpAdd
129. clusion of liability The software was produced and tested with utmost care by Hilscher Gesellschaft fur Systemautomation mbH and is made available as is No warranty can be assumed for the performance and flawlessness of the software for all usage conditions and cases and for the results produced when utilized by the user Liability for any damages that may result from the use of the hardware or software or related documents is limited to cases of intent or grossly negligent violation of significant contractual obligations Indemnity claims for the violation of significant contractual obligations are limited to damages that are foreseeable and typical for this type of contract It is strictly prohibited to use the software in the following areas for military purposes or in weapon systems for the design construction maintenance or operation of nuclear facilities in air traffic control systems air traffic or air traffic communication systems in life support systems in systems in which failures in the software could lead to personal injury or injuries leading to death We inform you that the software was not developed for use in dangerous environments requiring fail proof control mechanisms Use of the software in such an environment occurs at your own risk No liability is assumed for damages or losses due to unauthorized use 1 8 4 Export The delivered product including the technical data is subject to export or import laws as well as
130. code TLR_ b n e ERR_TI M HOUT_TCP_CMD_S END TCP Send timeout expired is returned the timeout for the data send operation expired and the connection was aborted All other error codes indicate that just the current command was rejected Source code example TLR_RESULT ApTcpCmdSendCnf 1 R_RESULT HEHE IS Re NEI Ie AD ASIC IR 1 SITE T BARG SIND CIN AR R_POOL_PACKE RS EAS T_RE Feturnt eRslt Ne TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Bll HERS H 1c LOC lOO joel She lt ptPck gt tHead ulSta DERSE TE SHG Hilscher 2005 2015 The application interface 95 134 6 2 13 TCPIP_UDP_CMD_SEND_REQ CNF Sending UDP data The TCPIP_UDP_CMD_SEND_REQ command can be used to transfer data to an UDP communication partner The target s IP address port number and the handle of an UDP socket opened with the TCP IP_TCP_UDP_CMD_OPEN command must be provided The data from this request command is sent in a UDP packet through the network and a confirmation command is returned immediately Note Please note the following limitations when sending UDP data Up to TCPIP_MAX_UDP_DATA_CNT 1472 bytes can be sent per UDP packet Packet structure typedef struct TCPIP_DATA_UDP_CMD_SEND_REO_Ttag
131. de LR_UINT8 abSenderMacAddr 6 IVR HHT Z ulSenderIpAddr LR_UINT8 abTargetMacAddr 6 LR_UINT32 ulTargetIpAddr TCPIP_ARP PACKET Typedef struct TCPIP_DATA_TCP_UDP_CMD_ACD_CONFLICT_IND_Ttag LR_UINT32 ulReason LR_UINT8 bAcdActivity TCPIP_ARP_ PACKET tLastConflictArp TCPIP DATA TCP UDP CMD ACD CONFLICT IND TT define TCPIP_DATA_TCP_UDP_CMD_ACD_CONFLICT_IND_SIZE sizeof TCPIP_DATA_TCP_UDP_CMD_ACD_CONFLICT_IND_T typedef struct TCPIP_PACKET_TCP_UDP_CMD_ACD_CONFLICT_IND_Ttag TLR_PACKET_HEADER_T tHead WEP INS DAMA Cl UND2 _ OMID AED CONTAC END SIS el WEP Ie J2NCIMS WC WII IEMID AED EORNITIELET IIND ER Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_ACD_CONFLICT_IND_T Type Indication Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of AP task process queue ulSrc UINT32 Source queue handle of TCP_UDP task process queue ulDestld UINT32 0 2 1 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 121 134 Structure TCPIP_PACKET_TCP_UDP_CMD_ACD_CONFLICT_IND_T Type Indication
132. dress assigned to this socket ulPort UINT32 2 65534 Local port number actually assigned to this socket ulProtocol UINT32 Protocol type used with this socket 1 TCP_PROTO_TCP Transmission Control Protocol TCP 2 TCP_PROTO_UDP User Datagram Protocol UDP Table 56 TCPIP_TCP_UDP_CMD_OPEN_CNF Confirmation command for opening a socket TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 69 134 Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC008007A R_E_TCP_ERR_PROTOCOL_UNKNOWN_TCP_UDP_CMD_OPEN The protocol parameter ulProtocol in command TCPIP_TCP_UDP_CMD_OPEN_REO is invalid 0xC008007B TLR_E_TCP_ERR_NO_SOCKETS_TCP_UDP_CMD_OPEN Command TCPIP_TCP_UDP_CMD_OPEN_REO There are no socket handles available 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080101 R_E_TCP_ERR_IP_ADDR_INVALID_TCP_UDP_CMD_OPEN The IP address parameter ulIpAddr in command TCPIP_TCP_UDP_CMD_OPEN_REO is invalid The parameter ulIpAddr must be zero 0 0 0 0 or equal to the TCP IP s
133. e ARP requests are possible The timeout for every ARP request is 1 second by default and can be changed by mode IP_PRM_SET_ARP_REQ_TMT Furthermore the command is aborted if a parameterized count of stations has answered before the timeout is elapsed For the request packet struct t SendArpTmtReq Parameter ulIpAddr is the IP address to check If parameter abEthernetAdadr is set to zero 0x00 0x00 0x00 0x00 0x00 0x00 a broadcast ARP request is send otherwise an unicast ARP request to the given MAC address is sent The parameter ulStationCntAbort defines the count of received stations when the command aborts before the timeout is elapsed A value of 0 results to an internal value of OxFFFFOOOO This means in the practice that there is no station limit only the timeout is active Furthermore the value is internal delimited to OxFFFFO000 no error occurs TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 37 134 For the confirmation packet struct t SendArpTmtCnf Parameter ul IpAddr is unchanged Parameter abEthernetAddr is unchanged Parameter ulStationCntAbort is unchanged Parameter ulStationCnt is the count of founded stations with the given IP address ullpAddr Parameter tStation is the station list MAC addresses of the received stations tStation 0 is the first received station tStation 1 the
134. e TCPIP_SRT_FLAG_ DBM 0x00000001L Use DBM database Config_x dbm x Task instance Otherwise the stack must be configured via TCPIP_IP_CMD_SET_CONFIG command E define TCPIP_SRT_FLAG_DBM ETHERNET_ADDR 0x00000002L Use MAC address from DBM database table ETHERNET Otherwise the MAC address 27 comes from EDD Conditon TCPIP_SRT_FLAG DBM must be set also L Add new flags also by startup parameter check in module z TepipTcpTask_Resources c function Bef TaskResource_TcpipTcpTask_InitLocal define TCPIP_SRT_FLAG FAST START 0x00000004L Activate fast start of TCP IP stack suppress the Gratuitous ARPs SM define TCPIP_SRT_FLAG_KEEP_ALIVE_PATCH 0x00000008L Activate SE answer if we receive wrong keep alive packets without any flags set 2 define TCPIP_SRT_FLAG ACTIVATE_ACD 0x00000010L Activate address conflict detection IMPORTANT Do not enable fast startup and ACD simultaneously ACD defense options when ACD is active one of these options need to be set define TCPIP_SRT_FLAG ACD _DEFEND_DEEF 0x00000020L Activates ACD option to defend ip address in any case define TCPIP_SRT_FLAG_ACD_DEFEND_COND 0x00000040L Activates ACD option to defend the ip address with the condition that there was no ip address conflict within the last 10 seconds 2 define TCPIP_SRT_FLAG_ACD_NO_DEFENSE 0x00000080L Activates ACD option to
135. e of the real time operating system rcX Knowledge of the TCP IP protocol suite TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Introduction 5 134 1 5 Specifications The data below applies to TCP IP stack version V2 2 x x 1 5 1 Supported protocols ARP Address Resolution Protocol REC 826 IP Internet Protocol RFC 791 ICMP Internet Control Message Protocol RFC 792 TCP Transmission Control Protocol RFC 793 RFC 896 IGMPv2 Internet Group Management Protocol Version 2 RFC 2236 UDP User Datagram Protocol RFC 768 BOOTP Bootstrap Protocol REC 951 RFC 1542 RFC 2132 DHCP Dynamic Host Configuration Protocol RFC 2131 RFC 2132 Ethernet frame types Ethernet II RFC 894 IEEE 802 3 receive only REC 1042 1 5 2 Technical data Feature Value Number of sockets Max 128 Startup parameter ARP cache size Max 512 entries Startup parameter ARP timeout 600 seconds by default Startup parameter 60 3600 seconds Route cache size 32 entries Route timeout 900 seconds IP multicast groups Receive 64 Send not limited IP multicast groups Receive 64 Send not limited IP datagram size Up to 1500 bytes Table 2 Technical Data TCP IP 1 5 3 Limitations IP fragmentation not supported TCP urgent data not supported TCP port 0 not supported UDP port 67 reserved for BOOTP and DHCP UDP port 25
136. e task is not initialized TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 63 134 Hex Value Definition Description 0xC0080106 TLR_E_TCP_ERR_IP_ADDR_INVALID_NO_GATEWAY The IP address parameter ulIpAdar is invalid because there is no gateway configured The parameter ul IpAddr must be inside the local network Table 53 TCPIP_IP_CMD_PING_CNF Packet status error Source code example TER RESULT Appena kimge Ber PITPEEN PERS KEERS CHE FEAR ptRse MCD 2 JYNCIE TIE ST e Ir NRE fone Pl TLR_RESULT Rslt ptPck gt tHead ulSta if TLR_S_OK eRslt ptRsc gt tLoc ulResponseTime ptPck gt tData ulResponseTime DERSPOOTBPACKEINEREIFEASE EpERSe ElgerhPoolr pERekE F return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 64 134 6 2 7 TCPIP_TCP_UDP_CMD_OPEN_REOQO CNF Opening a socket The TCP IP_TCP_UDP_CMD_OPEN command can be used by the application to obtain a handle for a socket of the specified protocol type This is always the first step to be taken for any socket based communication The newly created socket will be bound to the specified local IP address and local port number Note In gen
137. e to TCP sockets only Close socket immediately connection reset Applicable to TCP sockets only Table 58 TCPIP_TCP_UDP_CMD_CLOSE_REO Request command for closing a socket Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 59 TCPIP_TCP_UDP_CMD_CLOSE_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Source code example TLR_RESULT ApTcpUdpCmdCloseReq TCPIP_AP_TASK_RSC_T FAR INCI IDEE Ce if TLR_POO return T 1 PACKET_GET jm OE WORSE Sc LOS sacl 72 134 PERSCH BDBECMDEETOSBEREHORTFZEERIEPIEK oraz J TUR SOK iS_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask ptRsc gt tLoc ulSocket OUR ME INKS Pils ChGimo hh E CR IPERS C I T a Omni ptPck gt tHead ulLen TEPIE DATAZTCPTUDP OMD CLOSE REO STZES ptPck gt tHead ulld PrN gt eroesnllisnelleprd ptPck gt tHead ulSta Op ptPck gt tHead ulCmd TCRIP_TUP UDP EMD ELOSE REOF ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 Pele eEDatar lie lmcoute 07 0 Default cimeowe LT if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask TLR_POOL_PACK
138. ed The TCP IP stack task initialization can take up to 209 seconds dependent on the current configuration The actual time is mainly determined by the DHCP and BOOTP parameters The DHCP configuration mechanism requires up to 136 seconds and BOOTP requires up to 68 seconds to decide whether it succeeded or failed If the IP address is configured manually only the check for duplicate IP address assignment will be performed which takes about 3 seconds According to the fallback procedure described in section Description of the protocol at page 9 all three IP address configuration mechanisms can be combined Please look at the table below for a list of all combinations IP Configuration Mechanism Maximum Time Required seconds DHCP BOOTP Manually x 3 x 68 x x 71 x 136 x x 139 x x 204 X x X 209 Table 6 Start up of the TCP IP stack TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Sockets based programming model 12 134 4 Sockets based programming model The TCP_UDP task utilizes a sockets based approach in the handling of TCP and UDP communication The socket model implemented in the stack is loosely related to the well known BSD sockets or Winsock programming model However only the basic features known from these models are
139. efault configuration the initial size of this list is 128 Every send command TCPIP_TCP_CMD_SEND_REQ or TCPIP_UDP_CMD_SEND_REQ occupy one queue element until the confirmation command is given back to the application To avoid this resource problem the application must reduce the count of open send jobs over all sockets TLR_E_TCP_ERR_NO_ETH_OUT_BUFFER_UDP_CMD_SEND The UDP send command TCPIP_UDP_CMD_SEND_REQ must be rejected because all outgoing Ethernet buffers are occupied 0xC0080213 0xC0080214 TLR_E_TCP_ERR_NO_FREE_RESOURCE_FOR_ARP_REO_INTF The command TCPIP_IP_CMD_SET_PARAM_REO in mode IP_PRM_SEND_ARP_REQ IP_PRM_SEND_ARP_TMT_REQ must be rejected because all free resources for this command are occupied A maximum of 128 parallel jobs is possible TLR_E_TCP_ERR_ETH_OUT_SEND_BUFFER The send of the outgoing Ethernet buffer has failed The reason of this error is normally a resource problem there is no EDD buffer available 0xC0080220 R_E_TCP_ERR_MCAST_CREATE Failed to create an IP Multicast group 0xC0070300 R_E_IP_ERR_DEST_UNREACHABLE_IP_CMD_PING The target IP address ul IpAddr in command TCPIP_IP_CMD_PING_REO is not reachable 0xC0080301 R_E_TCP_ERR_DEST_UNREACHABLE_TCP_U
140. eleased Public Hilscher 2005 2015 The application interface Packet description Structure TCPIP_PACKET_IP_CMD_GET_PARAM_REQ T Type Request 50 134 Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for TCPIP_IP_xx packets ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 Packet data length in bytes See Table 34 TCPIP_IP_CMD_GET_PARAM_REQ Mode description for parameter data unParam ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 39 TCPIP_IP_CMD_GET_PARAM_REQ ulCmd UINT32 0x206 TCPIP_IP_CMD_GET_PARAM_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_IP_CMD_GET_PARAM_REQ T ulMode UINT32 Mode Type of parameter to be obtained See Table 34 TCP IP_IP_CMD_GET_PARAM_REQ Mode description for parameter data unParam unParam union Union unPar
141. en the server has finished processing it sends its response data through the TCP connection The stack receives the data from the network and sends it to the application using TCPIP_TCP_UDP_CMD_RECEIVE indication commands There will be as many TCPIP_TCP_UDP_CMD_RECEIVE indication commands as required to transport the servers data Please note that the stack sends TCPIP_TCP_UDP_CMD_RECEIVE indication commands automatically whenever data is received from the network There is no explicit receive request command because the application is assumed to be ready to handle received data once it has established a connection Thus the application should check for available indication commands from the stack on a regular basis Once the application has received all response data from the server it terminates the TCP connection by sending a TCP IP_TCP_UDP_CMD_CLOSE request command Tali 0 2 030 i77 0 0 TCP Connection i PS TCP_UDP_CMD_CLOSE Request Command Termination i 7 Socket gt TCP_UDP_CND_CLOSE Confirmation Command Device Figure 5 TCP client example TCPIP_TCP_UDP_CMD_CLOSE_REQ CNF When the connection is terminated the stack closes the socket and a
142. ennnnenennnnnnnenenennrnenn Table 58 TCPIP_TCP_UDP_CMD_CLOSE_REQ Request command for closing a Socket sse eee eee eee Table 59 TCPIP_TCP_UDP_CMD_CLOSE_REQ Packet status error uennensnnnnensennnensennnnennnnnnnnnnnnnen nennen nnnnnnrnnnnnenrennnn Table 60 TCPIP_TCP_UDP_CMD_CLOSE_CNF Confirmation command for closing a socket TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Appendix 132 134 Table 61 TCPIP_TCP_UDP_CMD_CLOSE_CNF Packet status error asses esec essere eee ener ennenen 74 Table 62 TCPIP_TCP_UDP_CMD_CLOSE_ALL_REQ Request command for closing all sockets 76 Table 63 TCPIP_TCP_UDP_CMD_CLOSE_ALL_REO Packet Status errOr eee eee eee eee 76 Table 64 TCPIP_TCP_UDP_CMD_CLOSE_ALL_CNF Confirmation command for closing all sockets 78 Table 65 TCPIP_TCP_UDP_CMD_CLOSE_ALL_CNF Packet status error unes
143. er limits ys Limits of TCPIP_STARTUPPARAMETER_VERSION 5 5 TCP IP stack V2 0 16 0 is a define TCPIP_STARTUPPARAMETER_VERSION_5 5 ATTENTION If you get here a f ETEL TSE error because Oi new nene or Cerina Se _3 gt A Check startup parameters for changes extensions 2 E g version 4 is because of incompatible changes in struct K TCPIP_TCP_TASK_SRI_BIF_T startup parameter PERJE E TET T st Min Default Max TCP IP stacks process queue size for AP packets ulQueElemCntAp ae yf define TCPIP_SRT_QUE_ELEM_CNT_AP_MIN 4 define TCPIP_SRT_QUE_ELEM CNT_AP_DEFAULT 32 define TCPIP_SRT_QUE_ELEM CNT AP MAX 1024 8 per socket max 7 count 128 8 z Min Default Max pool element count ulPoolElemCnt define TCPIP_SRT_POOL_ELEM_CNT_MIN 4 define TCPIP_SRT_POOL_ELEM_CNT_DEFAULT 64 Suggestion 4 per a TCPIP_SRT_SOCKET_MAX_CNT_DEFAULT 4 socket define TCPIP_SRT_POOL_ELEM_CNT_MAX 4096 Maximum 32 per TCPIP_SRT_SOCKET_MAX_CNT_MAX w socket 2 fers WOO IUD SraCko CNE NaCI tt Start flags ulStartFlags defin
144. eral the binding to a port number can be accomplished as described below at parameter ulPort in Table 54 TCPIP_TCP_UDP_CMD_OPEN_REQ Request command for opening a However the usage of TCP port addresses within the firmware can be restricted to a specific range of available port addresses such as 1024 2048 for instance by the Ethernet Interface TCP Port Numbers tag list entry If this entry has been applied to the firmware file using the tag list editor only the restricted range of port addresses is applicable With this command the AP task and the TCP_UDP task have to exchange their End Point Identifier of this socket connection that shall be established between both The End Point Identifier is a 32 Bit value specified by each process in order to associate incoming and address outgoing packets to the right Communication End Point The End Point Identifier of the TCP_UDP task is used as socket handle in the socket based communication The symbolic name for this socket handle for the following TCPIP_TCP UDP_xx commands is ulSocket The AP task has to specify its End Point Identifier in the ulSrcId of the initializing TCPIP_TCP_UDP_CMD_OPEN request packet In the event of a successful Initialization the TCP_UDP task uses this specified value in the ul SrcId variable of each Confirmation Packet and in the ulDestId variable for Indication Packets for example receive data indication command TCPIP_TCP_UDP_CMD_RECEIVE sent to the AP task cont
145. es sheddeaphieesesvuac tdesstieasassunadieustieeseentaand esate 8 2 Protocol parameters sroine aa irada aa ear iaaiiai anne a a 9 2 1 Sending configuration parameters USING Commande sss eee ee ee ee ee ee ee 9 2 2 Description of the protocol parameters sese eee eee eee eee 9 Start up of the TCP IP stack 4 4 244244200002000 02a ana sans sn wen za ann an ccuetastiesesudecederdateesvendescuectenee 11 Sockets based programming model uuuuesusnnnansnannnnnnnnnnnnnnnnnnnnnannunnnnnnnnnnnnnnnnnnannnnnnnnnnnnnnnannnnnannnnnn 12 K B Kama 961 Te1 11 10 190 4 11 o TFFERRECFSELPREAFPENBERTELTNETEBFPENFESTEELENFETFEESTERLERENFFFRTESFETSPERTFUERLTERFERTTERERFERFTLEPERTLEELERFERFEEEEN 12 4 2 TOP Server example xi cecee cessed sakes ee ie een Herner 15 4 3 UDP communication example mann nnnnn nn 18 The startup Parameters 4 2 se Has min 20 The application interface sss se vesse vesse essere sse ee sse essere serres sree nre enes e enes e enesenn eee 25 6 1 Configuration of the TCP IP stack esnsersesnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nen 25 6 2 The TOP UDP Taski otha Revista dein E nn en A a E E aS 26 6 2 1 TCPIP_IP_CMD_SET_CONFIG_REQ CNF Providing configuration data sese sees eee 27 6 2 2 TCPIP_IP_CMD_GET_CONFIG_REQ CNF Obtaining configuration daia sss sese eee 32 6 2 3 TCPIP_IP_CMD_SET_PARAM_REO CNF Setting IP parameters unsnsnsneensnnnnnnensnnnnnennnn 3
146. escription 0x00000000 TLR_S_OK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC000001A R_E_REQUEST_RUNNING Request is already running 0xC0080070 R_E_TCP_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized 0xC0080103 R_E_TCP_ERR_IP_ADDR_INVALID_UDP_CMD_SEND The IP address parameter ulIpAddr in command TCPIP_UDP_CMD_SEND_REO is invalid or doesn t match to the local sub network This error occurs if the IP address is zero 0 0 0 0 or equal to the address of the local subnet 0xC0080106 TLR_E_TCP_ERR_IP_ADDR_INVALID_NO_GATEWAY TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 99 134 Hex Value Definition Description 0xC0080112 TLR_E_TCP_ERR_PORT_INVALID_UDP_CMD_SEND The port parameter ulPort in command TCPIP_UDP_CMD_SEND_REQ is invalid or not available The parameter ulPort must be in range 0
147. esssnnnensennnnenennnnnnnnnnnennennnnenennnnnnnennnennnnenn 79 Table 66 TCPIP_TCP_CMD_WAIT_CONNECT_REQ Request command for waiting for an incoming TCP connection 81 Table 67 TCPIP_TCP_CMD_WAIT_CONNECT_REQ Packet sIatuga ierrOr see eee eee eee eee 81 Table 68 TCP IP_TCP_CMD_WAIT_CONNECT_CNF Confirmation command for waiting for an Incoming TCP connection Table 69 TCPIP_TCP_CMD_WAIT_CONNECT_CNF Packet status error ueesnnnnerssnnnensennnnenennnnnnnnnnnen nenn Table 70 TCP IP_TCP_CMD_CONNECT_REQ Request command for establishing a TCP connection Table 71 TCPIP_TCP_CMD_CONNECT_REQ Packet status error esse e seer e eser essere eee ener ennenen Table 72 TCPIP_TCP_CMD_CONNECT_CNF Confirmation command for establishing a TCP connection 88 Table 73 TCPIP_TCP_CMD_CONNECT_CNF Packet status error eee Table 74 TCPIP_TCP_CMD_SEND_REQ Request command for sending TCP data Table 75 TCPIP_TCP_CMD_SEND_REQ TCP send options ulOptions sese eee Table 76 TCPIP_TCP_CMD_SEND_REQ Packet status errof esser esse esec e essere essere serene ennenen ennenen enre Table 77 TCPIP_TCP_CMD_SEND_CNF Confirmation command for sending TCP dala sss sese 93 Table 78 TCPIP_TCP_CMD_SEND_CNF Packet status error nunesssnenersennnnensnnnnnenennnnn nennen ennnnnnnnnnnernennnnernrnnnennnnnnernenenn Table 79 TCPIP_UDP_CMD_SEND_REQ Request command for sending UDP data Table 80 TCPIP_UDP_CMD_SEND_REQ Packet status err
148. example TER RESULT ApIpCmdSetConfigCnf TCPIP_AP_TASK_RSC_T FARSER PERSI WEIN ANC RIE In AL GMb _ Siar COWIE TCS CNE MRAR EEk R_RESULT Rslt ptPck gt tHead ulSta WERSPOOTEPACKEIBEREITENSEN DESC EET Te Sea GHE EG S L return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 32 134 6 2 2 TCPIP_IP_CMD_GET_CONFIG_REQ CNE Obtaining configuration data The TCPIP_IP_CMD_GET_CONFIG command can be used to obtain the current configuration from the IP layer Parameters returned include IP address netmask IP address of default gateway and several flags Packet structure typedef struct TCPIP_PACKET_IP_CMD_GET_CONFIG_REQ Ttag TLR_PACKET_HEADER_T tHead TCPIP_PACKET_IP_CMD_GET_CONFIG_REO_T Packet description structure TCPIP_PACKET_IP_CMD_GET_CONFIG_REO_T Type Request Variable Type Value Range Description structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestId UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Pr
149. ext from now on This covers all following socket based packets TCPIP_TCP UDP_xx The TCP_UDP task returns its End Pointer Reference socket handle u Socket in ulDestId of the Confirmation Packet of the TCP IP_TCP_UDP_CMD_OPEN packet The AP task has to use this back coming value aS ulDestId value from now on in all request and response TCPIP_TCP UDP_xx packets that are sent to the TCP_UDP task context Using the Macro TLS_QUE_SENDPACKET_FIFO will send the packet to the TCP_UDP task Process Queue When working with an UDP socket the application can start sending data right away TCP IP_UDP_CMD_SEND once the socket is successfully opened Some more steps are required for TCP sockets A connection must be established using either the TCPIP_TCP_CMD_WAIT_CONNECT Or TCPIP_TCP_CMD_CONNECT command before being able transfer data TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 65 134 Packet structure Protocol types of packet ulProtocol variable define TCP_PROTO_TCP 1 define TCP_PROTO_UDP 2 typedef struct TCPIP_DATA_TCP_UDP_CMD_OPEN_REO_Ttag LR_UINT32 ullIpAddr ER ATE BDE AHH S T Pp TAR WANN IE Ie lp TICPIP_DATA_TCP_UDP_CMD_OPEN_REO_T define TCPIP_DATA_TCP
150. f socket for the incoming connection ulSrcld UINT32 0 2 1 Source End Point Identifier untouched ulLen UINT32 8 TCPIP_DATA_TCP_CMD_WAIT_CONNECT_CNF_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 See Table 69 TCPIP_TCP_CMD_WAIT_CONNECT_CNF ulCmd UINT32 0x307 TCPIP_TCP_CMD_WAIT_CONNECT_CNF Command ulExt UINT32 O Extension untouched ulRout UINT32 0 Routing do not touch Data Structure TCPIP_DATA_TCP_CMD_WAIT_CONNECT_CNF_T ullpAddr UINT32 IP address of remote client ulPort UINT32 0 65535 Port number of remote client Table 68 TCPIP_TCP_CMD_WAIT_CONNECT_CNF Confirmation command for waiting for an Incoming TCP connection Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000004 LR_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 LR_E_INVALID_PACKET_LEN Packet length is invalid 0xC000001A LR_E_REQUEST_RUNNING Request is already running 0xC0080070 LR_E_TCP_ERR_SOCKET_INVALID The socket handle ulDest Id is invalid A further reason for this error The command Mode is not applicable on this socket type TCP UDP 0xC0080079 LR_E_TCP_ERR_CONN_RESET The connection has closed by reset Hard
151. fine TCPIP_SRT_ARP_TIMEOUT_CACHE_MIN 60 1 minute os if define TCPIP_SRT_ARP_TIMEOUT_CACHE_DEFAULT 600 10 minutes aA define TCPIP_SRT_ARP_TIMEOUT_CACHE_MAX SiG0 0 eher E TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The startup parameters show the use of the startup parameters Source code example 24 134 The following source code example from rcX configuration file for example Config_netX c STATIC CONST FAR TCPIP_TCP_TASK_STARTUPPARAMETER_T tTcpipTcpTaskParam LR_TASK_TCPUDP ulTaskIdentifier TCPIP_STARTUPPARAMETER VERSION_5 ulParamVersion TCPIP_SRT_QUE_ELEM _CNT_AP_ DEFAULT ulQueElemCntAp TCPIP_ SRI_POOL_ ELEM ENT DEFAULT ulPoolElemCnt TCPIP_SRT_FLAG_DBM ulStartFlags Start flags see 2 TCPIP_SRT_FLAG xx in header 27 TepipTcpTask_Functionlist h ay ICIP WIZIRI INC LOHEINE IH WAHNE DIE DANDNENI AE ulTcpCycleEvent TCPIP_SRT_QUE_FREE_ ELEM CNT_DEFAULT ulQueFreeElemCnt TCPIP_SRT_SOCKET_MAX_CNT_DEFAULT ulSocketMaxCnt TCPIP_SRT_ARP_CACHE SIZE _DEFAULT ulArpCacheSize
152. implemented in order to simplify the communication and to adapt to the restrictions of an embedded device The main difference is the command based communication provided by the TCP IP stack as opposed to the function calls implemented by BSD sockets or Winsock libraries The function calls are represented by request command and confirmation command pairs in the TCP_UDP task You ll find a detailed description of all commands supported in section The application at page 25 In order to get an impression of how to make use of the socket communication and how to handle the commands involved some examples will be shown below The commands are explained in detail in chapter The TCP_UDP starting at page 26 4 1 TCP client example The TCP client example illustrates the command handling required by a simple TCP client application This application establishes a TCP connection to a remote server and it sends some request data The client then reads the response data supplied by the server followed by a shutdown of the connection oat foe fo AHT N i TCP_UDP_CMD_OPEN Request Command Socket a ee E p TCP_UDP_CMD_OPEN Confirmation Command Device Figure 1 TCP client example TCPIP_TCP_UDP_CMD_OPEN_REQ CNF The first step of any socket
153. ion Process ulSrcld UINT32 1 256 Source End Point Identifier specifying the origin of the packet inside the Source Process Socket handle ulSocket of the receiving socket ulLen UINT32 12 n TCPIP_DATA_TCP_UDP_CMD_RECEIVE_IND_SIZE n Packet data length in bytes nis the Application data count of abData 1472 in bytes n 1 TCPIP_MAX_TCP_UDP_DATA_CNT 1472 ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 97 TCPIP_TCP_UDP_CMD_RECEIVE_IND ulCmd UINT32 0x312 TCPIP_TCP_UDP_CMD_RECEIVE_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_UDP_CMD_RECEIVE_IND_T ullpAddr UINT32 Originating IP address ulPort UINT32 0 65535 Originating port Number ulOptions UINT32 Options of received data See Table 96 TCPIP_TCP_UDP_CMD_RECEIVE_IND Receive options ulOptions abData 1472 UINT8 Received application data with length n see also ulLen Table 95 TCPIP_TCP_UDP_CMD_RECEIVE_IND Indication command for receiving TCP data and UDP data The ulOptions parameter holds the option data in a bit oriented format Bits Name Bit mask Description 31 2 Reserved Reserved for future use 1 CP_RECV_OPT_MULTICAS Multicast flag 0x00000002 UDP multicast telegram 0 CP_R
154. iption ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 0 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for TCPIP_IP_xx packets ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 Packet data length in bytes See Table 17 TCPIP_IP_CMD_SET_PARAM_REQ Mode description for parameter data unParam ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 26 TCPIP_IP_CMD_SET_PARAM_REO ulCmd UINT32 0x204 TCPIP_IP_CMD_SET_PARAM_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_IP_CMD_SET_PARAM_REQ_T ulMode UINT32 Mode Type of parameter to configure See Table 17 TCPIP_IP_CMD_SET_PARAM_REQ Mode description for parameter data unParam unParam union Union unParam Parameter data to set See Table 17 TCPIP_IP_CMD_SET_PARAM_REQ Mode description for parameter data unParam and the following tables Table 16 TCPIP_IP_CMD_SET_PARAM_REQ Request command for setting IP parameters T
155. is value plus 27 Wis startup parameter ulEddQuePoolElemCnt EDD pE plus 3 reserve ulQueElemCntAp ulEddQuePoolElemCnt 3 fo Wein INCL IND SIN ONO aE CN T E EMEN gg 5 a TCP IP SRI QUE EB LEM CNT AP MAX TLR_UINT32 ulPoolElemCnt Size of pool elements for indication packets to AP One pool element allocates approx 1524 et ff bytes E Range TCPIP_SRT_POOL_ELEM_CNT_MIN ay Has TCPIP_SRT_POOL_ELEM_CNT_MAX eye Frese MOP VID Stacks Clejani aieibicaic oi wer LR_UINT32 ulStartFlags Start flags see TCPIP_SRT_FLAG_xx above LR_UINT32 ulTcpCycleEvent Cycletime of TCP_UDP task in ms call et ff fe intervall or iebiaciesiciys Like Trick S EEE E TRET DLE EE Woloisele LEES RET GI sac Must be greater or equal the OS cycletime af ptRsc gt tLoc ulTcpOsCycleTime fe Blaues WCRI SRW MED ONCE IT WADING_ MEIN 5 5 EN fre THIS HS ET CP_CYCLE_EVENT_MAX TLR_UINT32 ulQueFreeElemCnt Count of fr queu lements module 277 TcpipQueue c This is the list of free queue z elements to hold AP requests temporarily over all sockets sf Range TCPIP_SRT_QUE_FREE_ELEM_CNT_MIN TCPIP SRI_QOUE FREE ELE CNT_MAX TER UINTSZ ulSocketMaxCnt Count of sockets the TCP IP stack allocates RE AHIR EH EEE EET GHETTO S
156. lication for n a TCPIP_DATA_ REGISTER_ICMP_APP ICMP service IP_CMD_SET_PARAM_CNF_SIZE 9 4 Table 28 TCPIP_IP_CMD SET_PARAM_CNF Mode Description for Parameter Data unParam In error case ulLen The following TCPIP_DATA_IP_CMI tables is zero table describes D_SET_PARAM_CNF_T the union unParam structure The union elements are described in the following Union unParam Searches for more stations For definition see Table 31 TCPIP_IP_CMD_SET_PARAM_CNF Variable Type Value Range Description tSendArpCnf struct Confirmation structure for ARP send request interface For definition see Table 30 TCPIP_IP_CMD_SET_PARAM_CNF Struct tSendArpCnf of union unParam tSendArpTmtCnf struct Confirmation structure for ARP send request interface Struct tSendArpTmtCnf of union unParam Table 29 TCPIP_IP_CMD_SET_PARAM_CNF Union unParam TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 47 134 Structure tSendArpCnf Variable Type Value Range Description ullpAddr UINT32 IP address abEthernetAddr UINT8 6 Ethernet address MAC address Table 30 TCPIP_IP_CMD_SET_PARAM_CNF Struct tSendArpCnf of union unParam Structure tSendArpTmtCnf Variable Type Value Range
157. mand in Packet received 0xC0000007 TLR_E_INVALID_PACKET_LEN Packet length is invalid 0xC00800C8 R_E_TCP_TASK_F_NOT_INITIALIZED The task is not initialized Table 49 TCPIP_IP_CMD_GET_OPTIONS_CNF Packet status error Source code example TER RESULT ApIpCmdGetOptionsCnf TCPIP_AP_TASK_RSC_T JUNE JOEIRISIG IMC D2 eYNC ae 2 C MID _ Ei WMP ILOINS _ CINE INR Ee TLR_RESULT Rslt ptPck gt tHead ulSta if TLR_S_OK eRslt ptRsc gt tLoc ulOptions ptPck gt tData ulOptions WERSEOOTEPNCKEIBEREIEH SEI joie IRS C Sc Lyoye INO jocleXel lt 6 return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 60 134 6 2 6 TCPIP_IP_CMD_PING_REQ CNE Sending a ping The TCPIP_IP_CMD_PING command can be used to send an ICMP Echo Request packet Internet Control Message Protocol to the specified IP address The target IP stack should answer with an ICMP Echo Reply packet This command is similar to the commonly known ping program command Packet structure typedef struct TCPIP_DATA_IP_CMD_PING _REO_Ttag LR_UINT32 ullIpAddr LR_UINT32 ulTimeout TCPIP_DATA_IP_CMD_PING_REO_T define TCPIP_DATA_IP_CMD_ PING _REQ SIZE sizeof TCPIP_DATA IP CMD PING_REQ T
158. n the task will receive the result in the confirmation of the request Furthermore the AP task s process queue is keeping track of incoming packets for example packets with receive data The following chapters are describing the packets that may be received or may be sent by the AP task 6 1 Configuration of the TCP IP stack Normally the configuration will be stored into the non volatile flash memory The TCP IP stack reads this data block during its start up initialization and performs consistency checks The application can add change or delete parameters during run time These parameters will be kept in the RAM area of the device For this purpose the command TCPIP_IP_CMD_SET_CONFIG_REQ can be used Note Parameter sets stored in the RAM area will be lost if the board is powered down or ifa restart is performed TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 26 134 6 2 The TCP_UDP task The TCP_UDP task is the main task of the TCP IP stack It is responsible for all application interactions and represents the counterpart of the AP task within the existent TCP IP stack implementation To get the handle of the process queue of the TCP_UDP task the macro TLS_QUE z ENTIFY has to be used in conjunction with the following ASCII Queue name ASCII Queue name Description
159. n untouched ulRout UINT32 0 Routing do not touch Data Structure TCPIP_DATA_TCP_UDP_CMD_GET_SOCK_OPTION_CNF_T ulMode UINT32 Mode Type of option See Table 93 TCP IP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF Socket option data unParam unParam union Result data unParam See Table 93 TCP IP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF Socket option data unParam Table 92 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF Confirmation command for obtaining socket options TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 110 134 The structure of socket option unParam union in the Packet structure depends on the Mode parameter ulMode Default values are bold and underlined Mode ulMode Description Data type Value TCP_SOCK_TTL TTL value of outgoing IP UINT32 1 64 255 1 packets TCP_SOCK_SEND_TIMEOUT Current send timeout UINT32 1 31000 2 1 2 milliseconds TCP_SOCK_PROTOCOL Protocol type UINT32 CP_PROTO_TCP 1 3 CP_PROTO_UDP 2 TCP_SOCK_PORT Local port number UINT32 0 65535 4 TCP_SOCK_INACTIVE_TIMEOUT Inactivity timeout milliseconds UINT32 0 2 1 5 TCP_SOCK_KEEPALIVE_TIMEOUT Keep alive timeout UINT32 0 2 1 6 milliseconds TCP_SOCK_MULTICAST_TTL
160. n not in use set to zero for compatibility reasons ulRout UINT32 O Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_UDP_CMD_OPEN_REQ_T ullpAddr UINT32 Local IP address to use with socket 0 0 0 0 0 Bind socket to currently configured IP address 0 Bind socket to specified IP address must match currently configured IP address ulPort UINT32 Local port number to use with socket 0 Bind socket to next available port in range 1024 32257 1 Bind socket to next available port in range 513 1023 2 65534 Bind socket to specified port 65535 Bind socket to next available port in range 513 1023 ulProtocol UINT32 Protocol type to use 1 TCP_PROTO_TCP Transmission Control Protocol TCP 2 TCP_PROTO_UDP User Datagram Protocol UDP Table 54 TCPIP_TCP_UDP_CMD_OPEN_REQ Request command for opening a socket Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 55 TCPIP_TCP_UDP_CMD_OPEN_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Source code example Bind socket to currently configured IP
161. ns TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 105 134 Mode ulMode Description oo K_TTL Set TTL value for outgoing IP packets ts K_SEND_TIMEOUT Set new send timeout a K_INACTIVE_TIMEOUT Set inactivity timeout on K_KEEPALIVE_TIMEOUT Set keep alive timeout oo K_ADD_MEMBERSHIP Add IP multicast group membership Fla K_DROP_MEMBERSHIP Drop IP multicast group membership on K_MULTICAST_TTL Set TTL for multicast packets ne K_MULTICAST_LOOP Set loopback mode of outgoing multicast packets mma K_TOS Set TOS value for outgoing TCP and UDP packets Table 87 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Parameter ulMode Packet status error Hex Value Definition Description 0x00000000 TLR SOK Status ok 0xC0000004 R_E_UNKNOWN_COMMAND Unknown Command in Packet received 0xC0000007 R_E_INVALID_PACKET_LEN Packet length is invalid 0xC0080070 R_E_TC
162. o ARP cache and Delete entry from ARP cache For definition see Table 19 TCPIP_IP_CMD_SET_PARAM_REO Struct tAddDelArpEntry of union unParam tDelArpEntryIp tDelArpEntryMac struct struct Request structure for Delete entry from ARP cache For definition see Table 20 TCPIP_IP_CMD_SET_PARAM_REO Struct tDelArpEntryIp of union unParam Request structure for Delete all entries with specified MAC address from ARP cache For definition see Table 21 TCPIP_IP_CMD_SET_PARAM_ REQ Struct tDelArpEntryMac of union unParam tSendArpReq struct Request structure for ARP send request interface For definition see Table 22 TCPIP_IP_CMD_SET_PARAM_REQ Struct t SendArpReg of union unParam tSendArpTmtReq struct Request structure for ARP send request interface Searches for more stations For definition see Table 23 TCPIP_IP_CMD_SET_PARAM_ REQ Struct t SendArpTmtReq of union unParam tSetArpReqTmt struct Request structure for set timeout of ARP send request interface global value for every ARP request For definition see Table 24 TCPIP_IP_CMD_SET_PARAM_REQ Struct tSetArpReqTmt of union unParam tRegisterIcmp Service Struct Table 18 TCPIP_IP_CMD_SET_PARAM_REO Union unParam Request structure for registering a ICMP service For definition see Table 22 TCPIP_IP_CMD_SET_PARAM_REO
163. ocess Set to 0 for TCPIP_IP_xx packets ulSrcId UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 13 TCPIP_IP_CMD_GET_CONFIG_REQ ulCmd UINT32 0x202 TCPIP_IP_CMD_GET_CONFIG_REQ Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 0 Routing not in use set to zero for compatibility reasons Table 12 TCPIP_IP_CMD_GET_CONFIG_REQ Request command for obtaining configuration data Packet status error Hex Value Definition Description 0x00000000 TLR_S_OK Status ok Table 13 TCPIP_IP_CMD_GET_CONFIG_REO Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Source code example TLR_RESULT ApIpCmdGetConfigReq TCPIP_AP_TASK_RSC_T FAR ptRsc ICD Wey WYN al 2 OMI Ela COME IE ARVO Wey jpeg if TLR POOL PACKET GET ptRsc gt tLoc hPool amp ptPck TLR S_OK return TLR_E FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem
164. ode parameter ulMode Mode ulMode Description union element of ulLen unParam IP_PRM_GET_ARP_ENT Entry from ARP cache tArpEntry TCPIP_DATA_ RY_INDEX IP_CMD_GET_PARAM_CNF_SIZE 1 GET_ARP_ENTRY_INDEX 14 IP_PRM_GET_ Entry from ARP cache tArpEntry TCPIP_DATA_ ARP_ENTRY_IP IP_CMD_GET_PARAM_CNF_SIZE 2 GET_ARP_ENTRY_IP 14 IP_PRM_GET_ Entry from ARP cache tArpEntry TCPIP_DATA_ ARP_ENTRY_MAC IP_CMD_GET_PARAM_CNF_SIZE 3 GET_ARP_ENTRY_MAC 14 Table 41 TCPIP_IP_CMD_GET_PARAM_CNF Mode description for parameter data unParam In error case ulLen is zero TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 55 134 Union unParam Variable Type Value Range Description tArpEntry struct Confirmation structure for all three modes For definition see Table 43 TCPIP_IP_CMD_GET_PARAM_CNF Struct tArpEntry of union unParam Table 42 TCPIP_IP_CMD_GET_PARAM_CNF Union unParam Structure tArpEntry Variable Type Value Range Description ullpAddr UINT32 IP address abEthernetAddr UINT8 6 Ethernet address MAC address Table 43 TCPIP_IP_CMD_GET_PARAM_CNF Struct tArpEntry ofunion unParam Packet status error
165. ommand TCPIP_IP_CMD_SET_PARAM_REO could not be executed because the ARP cache is full The ARP cache has per default configuration 64 entries TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Status error codes overview 125 134 Hex Value Definition Description 0xC0070086 TLR_E_IP_ERR_ARP_ENTRY_NOT_FOUND_IP_CMD_SET_PARAM The specified ARP entry in command TCPIP_IP_CMD_SET_PARAM_REQ could not be deleted The ARP entry was not found in ARP cache 0xC0070087 TLR_E_IP_ERR_ARP_ENTRY_NOT_FOUND_IP_CMD_GET_PARAM The requested ARP information in command TCPIP_IP_CMD_GET_PARAM_REQ could not be delivered The ARP entry was not found in ARP cache 0xC00700FE R_E_IP_ Special internal error code returned by IpStart function ERR_DELAYED
166. onds direct with the Packet structure respectively Packet description fields in section The application starting at page 25 Parameter ulFlags The ulF lags parameter holds bit oriented flags according to the following table Bits Bit mask Description 31 15 Reserved for future use 14 IP_CFG_FLAG_NO_GRATUITOUS_ARP Enable Disable sending of gratuitous ARP frames If set sending is disabled 13 6 Reserved for future use 5 IP_CFG_FLAG_ETHERNET_ADDR Set Ethernet address MAC address If set the abEthernetAddr area will be evaluated 4 IP_CFG_FLAG_DHCP Enable DHCP If set the stack obtains its configuration from a DHCP server 3 IP_CFG_FLAG_BOOTP Enable BOOTP If set the stack obtains its configuration from a BOOTP server 2 IP_CFG_FLAG_GATEWAY Gateway available If set the content of the ulGateway parameter will be evaluated If the flag is not set the stack will assume that there exists no gateway 1 IP_CFG_FLAG_NET_MASK Netmask available If set the content of the ulNetMask parameter will be evaluated If the flag is not set the stack will assume to be an isolated host which is not connected to any network The ulGateway parameter will be ignored in this case 0 IP_CFG_FLAG_IP_ADDR IP address available If set the content of the ul pAddr parameter will be evaluated Table 5 Parameter ulFlags The valid combinations of flags for manual
167. or unnneersnnnnennennnensennnnennnnnnnnnennnnnnnnnnnenennnnnnnennnennnnenn Table 12 TCPIP_IP_CMD_GET_CONFIG_REQ Request command for obtaining configuration data Table 13 TCPIP_IP_CMD_GET_CONFIG_REO Packet StatuS rror eee eee eee eee Table 14 TCPIP_IP_CMD_GET_CONFIG_CNF Confirmation command for obtaining configuration data 34 Table 15 TCPIP_IP_CMD_GET_CONFIG_CNF Packet status error see eee eee eee Table 16 TCPIP_IP_CMD_SET_PARAM_ REQ Request command for setting IP parameters see eee eee eee eee eee Table 17 TCPIP_IP_CMD_SET_PARAM_REO Mode description for parameter data unParam Table 18 TCPIP_IP_CMD_SET_PARAM_ REQ Union WnBParan sese eee eee eee eee Table 19 TCPIP_IP_CMD_SET_PARAM_REQ Struct tAddDelArpEntry of union unParan Table 20 TCPIP_IP_CMD_SET_PARAM_REQ Struct tDelArpEntryIp Of UNION unParam sees eee eee Table 21 TCPIP_IP_CMD_SET_PARAM_REQ Struct tDelArpEntryMac of union unParam Table 22 TCPIP_IP_CMD_SET_PARAM_REO Struct tSendArpReq Of UNION WnPar anm see eee Table 23 TCPIP_IP_CMD_SET_PARAM_REQ Struct tSendArpTmtReg of union unParam 0 Table 24 TCPIP_IP_CMD_SET_PARAM_REQ Struct tSetArpReqTmt Of union unParan nneenn Table 25 TCPIP_IP_CMD_SET_PARAM_REO Struct tRegisterIcmpService of union unParam Table 26 TCPIP_IP_CMD_SET_PARAM_ REQ Packet status error sese eee eee eee Table 27 TCPIP_IP_CMD_SET_PARAM_CNF Confirma
168. or ueesssnenersennnnensnnnnnnnennnennennnnennnnnnnnnennnennennnnenennnnnrnnnnnerneneen Table 81 TCP IP_UDP_CMD_SEND_CNF Confirmation command for sending UDP data sss sese sees eee eee 98 Table 82 TCPIP_UDP_CMD_SEND_CNF Packet staiug ermror esser esse esser essere ereer eser neee 99 Table 83 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Request command for setting socket options 101 Table 84 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Socket option data unParam eee 102 Table 85 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REQ Packet status error ueeeenenerssnnnnensnnnnnennnnnen ernennen ernennen 103 Table 86 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Confirmation command for setting socket options 104 Table 87 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Parameter ulMode essen 105 Table 88 TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_CNF Packet status error uneensnenerssnnnnensnnnnnnnnnenen ernennen ernennen 106 Table 89 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ Request command for obtaining socket options 107 Table 90 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ Parameter ulMode Table 91 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_REQ Packet status error uueeeenenerssnnnnensnnnnnennnnnen ernennen ennnnnnnn Table 92 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF Confirmation command for obtaining socket options 109 Table 93 TCPIP_TCP_UDP_CMD_GET_SOCK_OPTION_CNF Socket option data unParam eee eee 110 Table 94 TCPIP_TCP_UDP_C
169. ould not be closed gracefully within this time For this timeout see command TCPIP_TCP_UDP_CMD_CLOSE_REQ parameter ulTimeout Table 61 TCPIP_TCP_UDP_CMD_CLOSE_CNF Packet status error Note The error codes TLR_E_TCP_ERR_TIMEOUT_TCP_UDP_CMD_CLOSE TCP Close timeout expired TLR Destination is unreachable and TLR_E_TCP_ERR_CONN_RESET Connection reset rather should be treated as a notification code because the socket is closed in these T _ TCP_ERR_DEST_UNREACHABLE_TCP_UDP_CMD_CLOSE E cases too However if one of the other error codes is returned the socket s state is not affected Source code example TLR_RESULT Apiiepldp ened eillose en Gul Pale we AD MELAS Kans CHI ARCS eS C WEP We INCI ACIS WIDE TRET RG S CINE Ie VAR EEE CR R_RESULT Rslt ptPck gt tHead ulSta TLR_POOL_PACKE DEREIEASENEpERSe_ S HT EITE return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 75 134 6 2 9 TCPIP_TCP_UDP_CMD CLOSE_ALL REQ CNF Closing all sockets Sending the TCPIP_TCP_UDP_CMD_CLOSE_ALL command will instruct the stack to close all sockets currently in use by the host s application Thus all previously obtained socket handles will become invalid
170. plication interface 115 134 6 2 17 TCPIP TCP UDP CMD SHUTDOWN IND RES Shutdown of the stack In some situations the stack is required to stop using the current IP address and thus it has to stop communicating on the network This can be caused by a DHCP lease expiring or by a TCPIP_IP_CMD_SET_CONFIG command being received by the stack In these cases the TCP IP stack will send a TCPIP_TCP_UDP_CMD_SHUTDOWN indication command to the application This command will tell the application to close all sockets and afterwards return the packet back to the TCP_UDP task For this the macro TLS_QUE_RETURNPACKET Should be used If the TCP IP stack doesn t receive the response command within 30 seconds after sending the TCPIP_TCP_UDP_CMD_SHUTDOWN indication command it will close all sockets automatically The TCP IP stack will then reenter initializing state and all further request commands will be rejected Please refer to the section Start up of the TCP IP at page 11 for a description of the stack s initialization procedure Packet structure typedef struct TCPIP_PACKET_TCP_UDP_CMD_SHUTDOWN_IND_Ttag TLR_PACKET_HEADER_T tHead TCPIP_PACKET_TCP_UDP_CMD SHUTDOWN_IND_T Packet description Structure TCPIP_PACKET_TCP_UDP_CMD_SHUTDOWN_IND_T Type Indication Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T
171. ptPck gt tData ulMode IP_PRM_GET_ARP_ENTRY_INDEX ptPck gt tData unParam tArpEntryIndex ullndex 0 First ARP cache entry if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask Prbeke 100 IIIS ONES il IMIG JOO IVANCIIH A IRIGIGHVASI IPERS S E ET TT TE IR BOPALIL js POL wri TERS OHE J TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 53 134 Packet structure typedef struct TCPIP_DATA_IP_CMD_GET_PARAM_CNF_Ttag TLR_UINT32 ulMode union SEICE LR_UINT32 ullIpAddr LR_UINT8 abEthernetAddr 6 tArpEntry unParam TCPIP_DATA_IP_CMD_GET_PARAM_CNF_T define TCPIP_DATA_IP_CMD_GET_PARAM_CNF_SIZE_GET_ARP_ENTRY_INDEX sizeof TLR_UINT32 10 sizeof tArpEntry define TCPIP_DATA_IP_CMD_GET_PARAM_CNF_SIZE_GET_ARP_ENTRY_IP sizeof TLR_UINT32 10 sizeof tArpEntry define TCPIP_DATA_IP_CMD_GET_PARAM_CNF_SIZE_GET_ARP_ENTRY_MAC N sizeof TLR_UINT32 10 sizeof tArpEntry typedef struct TCPIP_PACKET_IP_CMD_GET_PARAM CNF_Ttag TLR_PACKET_HEADER_T tHead TCPIP_DATA_IP_CMD_GET_PARAM_CNF_T tData TCPIP_PACKET_IP_CMD_GET_PARAM_CNE_T TCP IP Packet Interface DOC050201API13EN Revision
172. r Pepe uam orte ptRsc gt tLoc ulRemotelpAddr ptRsc gt tLoc ulRemotePort DEREPOOTBPACKEIERENEEN SEI EBERS C eroemhPooilmpeLeker return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 85 134 6 2 11 TCPIP_TCP_CMD CONNECT_REQ CNF Establishing a TCP connection The TCPIP_TCP_CMD_CONNECT request command can be used to actively establish a TCP connection to a remote partner A typical example would be a TCP client application connecting to a remote server The request command takes the IP address and port number of the remote station as well as the handle of a previously opened socket as parameters Additionally timeout values for the connection establishment process itself and for later data send commands can be given Packet structure typedef struct TCPIP_DATA_TCP_CMD_CONNECT_REQ_ Ttag LR_UINT32 ullIpAddr LRAUINTS2 ulPortz LR_UINT32 ulTimeoutSend LR_UINT32 ulTimeoutConnect TCPIP_DATA_TCP_CMD_CONNECT_REO_T define TCPIP_DATA_TCP_CMD_CONNECT_REQ_SIZE sizeof TCPIP_DATA_TCP_CMD_CONNECT_REQ_T typedef struct TCPIP_PACKET_TCP_CMD_CONNECT_REQ_ Ttag TLR_PACKET_HEADER_T tHead TCPIP_DATA_TCP_CMD_CONNECT_REO_T tData TCPIP_
173. r ulPort must be in range 1 65535 0xC0080112 TLR_E_TCP_ERR_PORT_INVALID_UDP_CMD_SEND The port parameter ulPort in command TCPIP_UDP_CMD_SEND_REO is invalid or not available The parameter ulPort must be in range 0 65535 0xC0070120 R_E_IP_ERR_TIMEOUT_INVALID_IP_CMD_PING The timeout parameter ul Timeout in command TCPIP_IP_CMD_PING_REO is invalid 0xC0080121 R_E_TCP_ERR_TIMEOUT_INVALID_TCP_UDP_CMD_CLOSE The timeout parameter ulTimeout in command TCPIP_TCP_UDP_CMD_CLOSE_REO is invalid Consider the distinction between TCP and UDP sockets For UDP sockets ul Timeout must be zero U TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Status error codes overview 128 134 Hex Value Definition Description 0xC0080122 TLR_E_TCP_ERR_TIMEOU T_INVALID_TCP_UDP_CMD_CLOSE ALL The timeout parameter ulTimeout in command TCPIP_TCP_UDP_CMD invalid CLOSE_ALL_REQ is 0xC0080123 LR_E_TCP ERR_TIMEOUT_I The timeout parameter ul Time VALI outSe D_TCP_CMD WAIT_CONNECT CPIP_TCP_CMD_WAIT CONNECT_R EQ is invalid nd and or ulTimeoutListen in command 0xC0080124 0xC0080125 LR_E_TCP ERR_TIMEOUT_I VALI CPIP_TCP_CMD_CON LR_E_TCP
174. receiving of TCP data and UDP data The ulOptions parameter holds the option data in a bit oriented format Bits Name Bit mask Description 31 0 Reserved Reserved for future use Table 101 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Receive options ulOptions Packet status error Hex Value Definition Description 0xC0080078 R_E_TCP_ERR_CONN_CLOSED The connection has closed Graceful close 0xC0080079 R_E_TCP_ERR_CONN_RESET The connection has closed by reset Hard close Table 102 TCPIP_TCP_UDP_CMD_RECEIVE_STOP_IND Packet status error TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface Source code example TLR_RESULT ApTcpUdpCmdReceiveStopInd ACIP _ IP YNCIK ED Le IN SUAS IC INSIST FST CEMUDE RCMDERECEHTVE TLR_RESULT Rslt ptPck gt tHead ulSta if ptPck gt tHead ulSrcId ptRsc gt tLoc ulSocket End of data marker received no further data receive if ptPck gt tHead ulSta TLR_E CPZERR CONN CLOSED f Graccu eloge s else if ptPck gt tHead ulSta TL Hard close else Wrong socket handle TLS_QUE_RETURNPACKET ptPck return eRslt TCP IP Packet Interface INCE ERR_CONN_RE
175. refore the application has to take care that the socket is closed again For instance if a TCP Client establishes a connection transfers data and finally closes the connection the port will remain unreachable if the application does not react to this indication with the sequence TCPIP_TCP_UDP_CMD_CLOSE T 20 gt TCP IP Stack Q TCPIP_TCP_UDP_CMD_CLOSE_CNF lt TCP IP Stack TCPIP_TCP_UDP_CMD_OPEN_REQ gt TCP IP Stack TCPIP_TCP_UDP_CMD_OPEN_CNF lt TCP IP Stack TCPIP_TCP_CMD_WAIT_CONNECT_REQ gt TCP IP Stack Packet structure typedef struct TCPIP_DATA_TCP_UDP_CMD_RECEIVE_STOP_IND_Ttag LR_UINT32 ullpAddr LR ONT SI ELPore LR_UINT32 ulOptions ET SEAT EDER EP DPEREM DER REINE ap TEV T H BI ITN define TCPIP_DATA_TCP_UDP_CMD_RECEIVE_STOP_IND_SIZE sizeof TCPIP_DATA_TCP_UDP_CMD_RECEIVE_STOP_IND_T typede amp struct TCPIP_PACKET_TCP_UDP_CMD_RECEIVE_STOP_IND_Ttrag TLR_PACKET_HEADER_T tHead TCPIP_DATA_TCP_UDP_CMD_RECEIVE_STOP_IND_T tData TCPIP_PACKET_TCP_UDP_CMD_RECEIVE_STOP_IND_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 118 134 Packet description Structure TCP
176. riwel lt e l wink SOK return TLR_E FAIL S_QUE_LINK_SET_NEW_DESTID ptRsc gt tRem tQueTcpTask ptRsc gt tLoc ulSocket SOW I WIN Sie PACKEMESRCIPCECk RAPERS C _ Sltoemieknkorze e ptPck gt tHead ulLen TCPIP_ DATA TCP _ CMD _ CONNECT REQ SIZE ptPck gt tHead ulld EEE IES C e KOCR SNEEP EE ptPck gt tHead ulSta 0 ptPck gt tHead ulCmd TCPIP_TCP_CMD_CONNECT_REO ptPck gt tHead ulExst 0 ptPck gt tHead ulRout 0 ptPck gt tData ullpAddr REMOTE_IP_ADDR PEPCK ZT Data uUlFSOrE REMOTE_PORT ptPck gt tData ulTimeoutSend 0p 0 Berau le eimeone Sil 8 ptPck gt tData ulTimeoutConnect 0 0 Default timeout 31 s if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask Pebekr 1 00 WE AMIE SOND IMIR IANO INCH W IRIE IGEVANSIS DERSE Seine MEO CPER EEC KEDE returnt TERR OPAL 4 return TLR SOK ye Packet structure typedef struct TCPIP_DATA_TCP_CMD_CONNECT_CNF_Ttag LR_UINT32 ulIpAddr HREN ABOT e TCPIP_DATA_TCP_CMD_CONNECT_CNF_T define TCPIP_DATA_TCP_CMD_CONNECT_CNF_SIZE sizeof TCPIP_DATA_TCP_CMD_CONNECT_CNF_T typedef struct TCPIP_PACKET_TCP_CMD_CONN TLR_PACKET_HEADER_T tHead EG SEGR DS IEL ONNE T T HET K eet Detter TCPIP_PACKET_TCP_CMD_CONNECT_CNF_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public ECT_CNF_Ttag 87 134 y N Hilscher 2005
177. s Overview TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Appendix 131 134 8 Appendix 8 1 List of tables Table 1 List of REVISIONS a ei nen a Wee ea ei ie een ee pl a i eles Table 2 Technical Data TOP IP Table 3 Terms Abbreviations and Definitions Table 4 References to Documents Hable 5sParameter R ag SS E E E E A E E e Table 6 Start up ofthe TO PP SAO k a een nn nein E A E ls Back Table 7 TCP_UDP Task process queue T x csxe KEZ YS ioien a aaie nae iiai The ieii deiei aiy Table 8 TCPIP_IP_CMD_SET_CONFIG_REQ Request command for providing configuration data Table 9 TCPIP_IP_CMD_SET_CONFIG_REQ Packet status error sese essere sese eee enserre ennenen Table 10 TCPIP_IP_CMD_SET_CONFIG_CNF Confirmation command for providing configuration data 30 Table 11 TCPIP_IP_CMD_SET_CONFIG_CNF Packet status err
178. second and so on The first SEND_ARP_TMT_STATION_MAX 100 stations are stored Mode IP_PRM_SEND_ARP_TMT_REQ_W_CACHEENTRY is the same as mode IP_PRM_SEND_ARP_TMT_REO but the ARP replies from remotes are additionally integrated in the ARP cache With mode IP_PRM_SET_ARP_REQ_TMT the timeout for the ARP requests can be set The default value is 1 second For the request packet struct tSetArpReqTmt Parameter ulTimeout is the global timeout for the ARP requests in milliseconds The range is ARP_REQ_INTF_TIMEOUT_MIN 100 ms ARP_REQ_INTF_TIMEOUT_MAxX 60000 ms The confirmation packet has no parameter Register ACD application This mode can be used to register an application at the Tcplp stack in order to receive an indication packet when an address conflict occurred The ACD mechanism can be enabled using the corresponding flag TCPIP_SRT_FLAG_ACTIVATE_ACD in the startup parameters of the TCP IP stack Register ICMP Indication Is the application registered to this service the Tcplp stack will send an indication TCPIP_IP_CMD_ICMP_IND to the application if an ICMP packet of the registered type was received The request is fully processed by the Tcplp stack there is no possibility to handle the request by the application Packet structure
179. sult code from the last socket closed in its ulSta EOUT_TCP_UDP_CMD CLOSE _ALL of timeout codes Close ES E_TCP_ERR_CONN_R ET Connection reset rather should be treated as a notification code because all sockets were closed in these cases too However if one of the other error codes is returned the command was rejected immediately and the socket s state is not affected Source code example TER RESULT ApTcpUdpCmdCloseAllCnf R_RESULT WEP E E R INS EGILE EIR SE EE HIDUE 1 HIE RIE Ia AIL CAN IE ARE EARS TLR_POOL_PACKE E RE EAS return eRslt TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Rslt ptPck gt tHead ulSta PDEs Ca gt ah OCMIL OOO Lek DERSES ptPck Hilscher 2005 2015 The application interface 80 134 6 2 10 TCPIP_TCP_CMD WAIT _CONNECT_REQ CNF Waiting for an Incoming TCP connection Using the TCPIP_TCP_CMD_WAIT_CONNECT request command a socket can be put into listening state in order to wait for an incoming TCP connection A TCP server application waiting for connection requests from remote clients may serve as an example here The request command requires the handle of a previously opened socket and two timeout values to be provided The send timeout value determines a maximum wait time for future TCPIP_TCP_CMD_SEN
180. tQueTcpTask 0 SR OULMEI HEN Ka OH im AGhib imo Cr Gots Cla PERS C tall EIR Cums ie ptPck gt tHead ulLen U BE e Daa or ehis O T tam ptPck gt tHead ulld TSIEN TEOS ARES Ghe E GEE T ptPck gt tHead ulSta 0 ptPck gt tHead ulCmd TCPiP IP CMD GET CONFIG REO ptPck gt tHead ulExt 0 ptPck gt tHead ulRout 0 if TLS_QUE_SENDPACKET_FIFO ptRsc gt tRem tQueTcpTask BERCK 100 TLR_S_OK Pine OLPACKH SRE LEASH piss C H LOO spt LC m e rerurn eT ERA R oA ih 4 Peturad TER S OK 13 Packet structure typedef struct TCPIP_DATA_IP_CMD_GET_CONFIG_CNF_Ttag LR_UINT32 ulFlags LR_UINT32 ullIpAddr LR_UINT32 ulNetMask LR_UINT32 ulGateway LR_UINT8 abEthernetAddr 6 TEPIP_DATA TP CMD_ GET CONF IG_CNE_T define TCPIP_DATA_IP_CMD_GET_CONFIG_CNF_SIZE sizeof TCPIP_DATA_IP_CMD_GET_CONFIG_CNE T T I STI TT typedef struct TCPIP_PACKET_IP_CMD TLR_PACKET_HEADER_T tHead TCPIP_DATA_IP_CMD_GET_CONFIG_CNF_T tBatay TCPIP_PACKET_IP_CMD_GET_CONFIG_CNF_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public 33 134 Hilscher 2005 2015 The application interface 34 134 Packet description Structure TCPIP_PACKET_IP_CMD_GET_CONFIG_CNF_T Type Confirmation Vari
181. tacks own IP address 0xC0080110 TLR_E_TCP_ERR_PORT_INVALID_TCP_UDP_CMD_OPEN The port parameter ulPort in command TCPIP_TCP_UDP_CMD_OPE available The N parameter ulPort must be in range 0 65535 EQ is invalid or not Table 57 TCPIP_TCP_UDP_CMD_OPEN_CNF Packet status error Source code example TER RESULT ApTcpUdpCmdOpenCnf TCPIP_AP_TASK_RSC_T FAR TCEPIP_PACKET_ TCP_UDP_CMD_OPEN_CNF_T FAR LR_RESULT Rslt ptPck gt tHead ulSta if TLR_S_OK eRslt ptRsc gt tLoc ullpAddr ptPck gt tData ullpAddr ptRsc gt tLoc ulPort ptPck gt tData ulPort LERSE Bloc ETO HO COME Eprber eDasar Protocol ptRsc gt tLoc ulSocket ptPck gt tHead ulDestId TLR_POOL_PACKET_RELEASE ptRsc gt tLoc hPool ptPck COUIEANVGERSLE 17 TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public PERSCH ptPck Hilscher 2005 2015 The application interface 70 134 6 2 8 TCPIP_TCP_UDP_CMD_CLOSE_REQ CNF Closing a socket The TCPIP_TCP_UDP_CMD_CLOSE command works for both TCP and UDP sockets It will close a currently active socket and will destroy its socket handle If the socket was connected to a remote TCP communication partner the connection will be terminated The request command expects a socket handle and a timeout value to be provided The timeout parameter applies to TCP
182. taining the current parameters from the IP layer Access to the IP stacks ARP cache is currently implemented Packet structure Valid modes of packet ulMode variable define IP_PRM _GET_ARP_ENTRY_INDEX 1 define IP_PRM_GET_ARP_ENTRY_IP 2 define IP_PRM_GET_ARP_ENTRY_MAC 3 typedef struct TCPIP_DATA_IP_CMD_GET_PARAM REO_Ttag TLR_UINT32 ulMode union STEIGH TLR_UINT32 uliIndex tArpEntry Index SELuCE TLR_UINT32 ullipAddr tArpEntryIp STEIGH TLR_UINT8 abEthernetAddr 6 tArpEntryMac unParam TCPIP_DATA_IP_CMD_GET_PARAM_ REQ Z define TCPIP_DATA_IP_CMD_GET_PARAM REQ SIZE_GE ARP_ENTRY_INDEX sizeof TLR_UINT32 A sizeof tArpEntryIndex define TCPIP_DATA_IP_CMD_GET_ PARAM REQ SIZE_GE 54 D H 0 E 9 sizeof TLR_UINT32 4 sizeof tArpEntryIp define TCPIP_DATA_IP_CMD_GET_ PARAM REQ SIZE GET _ARP_ENTRY_MAC sizeof TLR_UINT32 6 sizeof tArpEntryMac typedef struct TCPIP_PACKET_IP_CMD_GET_PARAM REQ Ttag T tHead GET _PARAM REQ T tData TLR_PACKET_HEADER EEE S IDAA 122 CIMID TCPIP_PACKET_IP_CMD_GET_PARAM REO_T TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 R
183. the TCP IP stacks own IP address 0xC0080102 TLR_E_TCP_ERR_IP_ADDR_INVALID_TCP_CMD_CONNECT The IP address parameter ulIpAddr in command TCPIP_TCP_CMD_CONNECT_REO is invalid The parameter ulIpAddr must be unequal to the TCP IP stacks own IP address 0xC0080103 TLR_E_TCP_ERR_IP_ADDR_INVALID_UDP_CMD_SEND The IP address parameter ulIpAddr in command TCPIP_UDP_CMD_SEND_REQ is invalid or doesn t match to the local sub network This error occurs if the IP address is zero 0 0 0 0 or equal to the address of the local subnet 0xC0080104 LR_E_TCP_ERR_IP_ADDR_INVALID_TCP_UDP_CMD_SET_SOCK_OPTION The parameter ulMulticastGroup ulMode TCP_SOCK_ADD_MEMBERSHIP Or TCP_SOCK_DROP_MEMBERSHIP in command TCPIP_TCP_UDP_CMD_SET_SOCK_OPTION_REO is invalid The parameter ulMulticastGroup must be a valid Multicast address Valid Multicast addresses are 224 0 0 1 239 255 255 255 224 0 0 0 is reserved as Base multicast address 0xC0080106 TLR_E_TCP_ERR_IP_ADDR_INVALID_NO_GATEWAY The IP address parameter ulIpAdar is invalid because there is no gateway configured The parameter ul IpAddr must be inside the local network 0xC0080110 TLR_E_TCP_ERR_PORT_INVALID_TCP_UDP_CMD_OPEN The port parameter ulPort in command TCPIP_TCP_UDP_CMD_OPEN_REO is invalid or not available The parameter ulPort must be in range 0 65535 0xC0080111 TLR_E_TCP_ERR_PORT_INVALID_TCP_CMD_CONNECT The port parameter ulPort in command TCPIP_TCP_CMD_CONNECT_REO is invalid or not available The paramete
184. tion command for setting IP parameters sese eee eee eee Table 28 TCPIP_IP_CMD_SET_PARAM_CNF Mode Description for Parameter Data unParam sese eee eee Table 29 TCPIP_IP_CMD_SET_PARAM_CNF Union unParam Table 30 TCPIP_IP_CMD_SET_PARAM_CNF Struct tSendArpCnf Of UNION WnPar arm se see eee Table 31 TCPIP_IP_CMD_SET_PARAM_CNF Struct tSendArpTmtCnf Of union unParam esse eee eee Table 32 TCPIP_IP_CMD_SET_PARAM_CNF Packet status error eee ee eee eee eee Table 33 TCPIP_IP_CMD_GET_PARAM_REO Request command for obtaining IP parameters seeen Table 34 TCPIP_IP_CMD_GET_PARAM_REO Mode description for parameter data unParam Table 35 TCPIP_IP_CMD_GET_PARAM_ REQ Union unParam uunneneeensennnnensnnnnnnnennnennennnnennnnnnnnnennnernrnnnnerernnnnerennnerr nenn Table 36 TCPIP_IP_CMD_GET_PARAM_REO Struct tArpEntryIndex Of union unParam esse eee Table 37 TCPIP_IP_CMD_GET_PARAM_REO Struct tArpEntryIp Of UNION WnPar arm se eee eee Table 38 TCPIP_IP_CMD_GET_PARAM_REO Struct tArpEntryMac Of union unParan naeessnssensennennnsnnnnnnnennnnnnennen Table 39 TCPIP_IP_CMD_GET_PARAM_REO Packet status error eee eee eee eee Table 40 TCPIP_IP_CMD_GET_PARAM_CNF Confirmation Command for obtaining IP Parameters Table 41 TCPIP_IP_CMD_GET_PARAM_CNF Mode description for parameter data unParan Table 42 TCPIP_IP_CMD_GET_PARAM_CNF Union unParam sssresseesssere esser essere esen ennenen ennenen nenen Table 43
185. ts by qualified experts however errors cannot be ruled out For this reason no guarantee can be made and neither juristic responsibility for erroneous information nor any liability can be assumed Descriptions accompanying texts and documentation included in the user manual do not present a guarantee nor any information about proper use as stipulated in the contract or a warranted feature It cannot be ruled out that the user manual the accompanying texts and the documentation do not correspond exactly to the described features standards or other data of the delivered product No warranty or guarantee regarding the correctness or accuracy of the information is assumed We reserve the right to change our products and their specification as well as related user manuals accompanying texts and documentation at all times and without advance notice without obligation to report the change Changes will be included in future manuals and do not constitute any obligations There is no entitlement to revisions of delivered documents The manual delivered with the product applies Hilscher Gesellschaft fur Systemautomation mbH is not liable under any circumstances for direct indirect incidental or follow on damage or loss of earnings resulting from the use of the information contained in this publication TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Introduction 8 134 1 8 3 Ex
186. ture TCPIP_PACKET_TCP_CMD_WAIT_CONNECT_REQ_T Type Request Variable Type Value Range Description Head Structure TLR_PACKET_HEADER_T ulDest UINT32 Destination queue handle of TCP_UDP task process queue ulSrc UINT32 Source queue handle of AP task process queue ulDestld UINT32 1 256 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to the socket handle ulSocket for request packet Handle of socket to connect ulSrcld UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 8 TCPIP_DATA_TCP_CMD_WAIT_CONNECT_REQ_SIZE Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 See Table 67 TCPIP_TCP_CMD_WAIT_CONNECT_REO ulCmd UINT32 0x306 TCPIP_TCP_CMD_WAIT_CONNECT_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 O Routing not in use set to zero for compatibility reasons Data Structure TCPIP_DATA_TCP_CMD_WAIT_CONNECT_REQ_T ulTimeoutSend UINT32 Send timeout Timeout for future send commands 0 Default timeout 81000 milliseconds 1 3221 Wait up to specified time for transfer of data time in milliseconds ulTimeoutListen UINT32 Connect timeout Timeout for wait
187. ure TCPIP_DATA_IP_CMD_GET_PARAM_REQ_T The union elements are described in the following tables Union unParam Variable Type Value Range Description tArpEntry Index struct Request structure for Get ARP entry at specified cache index For definition see Table 36 TCPIP_IP_CMD_GET_PARAM_REQ Struct tArpEntryIndex of union unParam tArpEntryIp struct Request structure for Get entry with specified IP address from ARP cache For definition see Table 37 TCPIP_IP_CMD_GET_PARAM_REQ Struct tArpEntryIp of union unParam tArpEntryMac struct Request structure for Get first entry with specified MAC address from ARP cache For definition see Table 38 TCPIP_IP_CMD_GET_PARAM_REQ Struct tArpEntryMac of union unParam Table 35 TCPIP_IP_CMD_GET_PARAM_ REQ Union unParam Structure tArpEntryIndex Variable Type Value Range Description ullndex UINT32 0 63 ARP cache index This value is the ARP cache size minus 1 By default configuration the ARP cache size is TCPIP_SRT_ARP_CACHE_SIZE_ DEFAULT 64 see startup parameter ulArpCacheSize Table 36 TCPIP_IP_CMD_GET_PARAM_REOQ Struct tArpEnt ryIndex of union unParam TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 The application interface 52 134 Structure tArpEntryIp
188. vision 7 English 2013 Hilscher Gesellschaft fur Systemautomation mbH Dual Port Memory Interface Manual netX based products Revision 12 English 2012 Table 4 References to Documents TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Introduction 7 134 1 8 Legal notes 1 8 1 Copyright Hilscher 2005 2015 Hilscher Gesellschaft fur Systemautomation mbH All rights reserved The images photographs and texts in the accompanying material user manual accompanying texts documentation etc are protected by German and international copyright law as well as international trade and protection provisions You are not authorized to duplicate these in whole or in part using technical or mechanical methods printing photocopying or other methods to manipulate or transfer using electronic systems without prior written consent You are not permitted to make changes to copyright notices markings trademarks or ownership declarations The included diagrams do not take the patent situation into account The company names and product descriptions included in this document may be trademarks or brands of the respective owners and may be trademarked or patented Any form of further use requires the explicit consent of the respective rights owner 1 8 2 Important notes The user manual accompanying texts and the documentation were created for the use of the produc
189. wNameNetX Adapted to rcX V2 0 8 0 new TLR_ TLS_ LIB_ macros 12 2012 03 15 VD TCP IP stack version V2 1 x x AB Actualized Source code examples PING timeout 10 s gt 1s Added ICMP Ping receive Indication HH Added ACD Address Conflict Detection Added ARP Request interface mode IP_PRM_SEND_ARP_TMT_REQ_W_CACHEENTRY Added socket option TCP_SOCK_VLAN Minor rework Added error code TLR_E_NOT_CONFIGURED 13 2015 09 10 TCP IP stack version V2 2 x x KM 6 2 19 ACD indication parameters updated RG 6 2 7 Note added Table 1 List of Revisions TCP IP Packet Interface DOC050201API13EN Revision 13 English 2015 09 Released Public Hilscher 2005 2015 Tee Xz ZEEE 1 2 Functional overview The stack has been written in order to meet the corresponding RFCs Request for Comments See section Specifications at page 5 for further information The main functionality from application view is TCP and UDP communication 1 3 System requirements This software package has following system requirements to its environment netX Chip as CPU hardware platform operating system for task scheduling required operating system independency rcX or Windows CE are implemented as a reference Stack portable to any other processor technology 1 4 Intended audience This manual is suitable for software developers with the following background Knowledge of the programming language C Knowledge of the us

Download Pdf Manuals

image

Related Search

Related Contents

EN Dear Customer, Gigaset Communications GmbH is the legal  ISDS software User's manual (for sebum/moisture/pigment analysis)  Samsung NV4 Manual de utilizare  Les bonnes adresses  

Copyright © All rights reserved.
Failed to retrieve file