]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_A2F200_SoftConsole/MicroSemi_Code/drivers/mac/tcpip.h
Corrected a comment in the STM32 FreeRTOSConfig.h file.
[freertos] / Demo / CORTEX_A2F200_SoftConsole / MicroSemi_Code / drivers / mac / tcpip.h
1 /*******************************************************************************\r
2  * (c) Copyright 2009 SLS Corporation,All Rights Reserved.  \r
3  * \r
4  *  tcpip.h:header file of TCP/IP implementation.\r
5  * \r
6  *  Version       Author         Comment\r
7  *  1.0.0         SLS corp.              First release,16 Jan 2009\r
8  */\r
9 #ifndef TCPIP_H_\r
10 #define TCPIP_H_\r
11 \r
12 #define FLASH_CONTEXT_INDICATOR      0x20000000\r
13 #define FLASH_SELFWAKEUP_INDICATOR       0x20000001\r
14 #define FLASH_CONTEXT_LOCATION       0x20000002\r
15 \r
16 /***************************************************************************//**\r
17  * Replies to ARP requests.\r
18  * \r
19  * @param  buf      Pointer to the recieved buffer from Ethernet MAC.\r
20  * \r
21  */\r
22 unsigned char send_arp_reply(unsigned char *buf);\r
23 /***************************************************************************//**\r
24  * Sends gratuitous arp brodcast message to the LAN.\r
25  * \r
26  * @param  buf      Pointer to the recieved buffer from Ethernet MAC.\r
27  *  \r
28  */\r
29 void send_gratuitous_arp(unsigned char *buf);\r
30 /***************************************************************************//**\r
31  * Calculates the checksum for Ethernet data in the header.\r
32  * \r
33  *  @param  buf      Pointer to the recieved buffer from Ethernet MAC.\r
34  *  @param  len          Number of bytes.\r
35  *  @param  pos      position for the check sum.   \r
36  * \r
37  *  @return          value of the checksum\r
38  */\r
39 unsigned short int get_checksum(unsigned char *buf, unsigned short int len, unsigned short int pos);\r
40 /***************************************************************************//**\r
41  * Calls internally to get_checksum and fixes the value of the checksum to\r
42  * position.\r
43  * \r
44  *  @param  buf      Pointer to the recieved buffer from Ethernet MAC.\r
45  *  @param  len          Number of bytes.\r
46  *  @param  pos      position for the check sum.\r
47  * \r
48  *   @return         OK\r
49  */\r
50 unsigned char fix_checksum(unsigned char *buf, unsigned short int len, unsigned short int pos);\r
51 /***************************************************************************//**\r
52  * Checks the calculated checksum for the errors.\r
53  * \r
54  * @param  buf      Pointer to the recieved buffer from Ethernet MAC.\r
55  * @param  len          Number of bytes.\r
56  * @param  pos      position for the check sum.\r
57  * \r
58  * @return OK       If there is no error\r
59  *             ERR              If there is error in the data                   \r
60  */\r
61 unsigned char check_checksum(unsigned char *buf, unsigned short int len, unsigned short int pos, char type);\r
62 /***************************************************************************//**\r
63  * Sends the reply to ICMP request like PING.\r
64  * \r
65  * @param  buf      Pointer to the recieved buffer from Ethernet MAC.\r
66  */\r
67 unsigned char send_icmp_echo_reply(unsigned char *buf);\r
68 /***************************************************************************//**\r
69  * Converts the input integer to the ascii char and fills in the buffer. \r
70  * \r
71  *  @param  buf      To filled in by the ascii value.\r
72  *  @param  n            integer number\r
73  */\r
74 void dtoa_reverse(unsigned short int n, unsigned char *buf);\r
75 /***************************************************************************//**\r
76  * Sends DHCP request to the server available in LAN.\r
77  * \r
78  * @param  buf       Pointer to the recieved data in case of DHCP reply.Zero for request. \r
79  */\r
80 void send_bootp_packet (unsigned char *buf);\r
81 /***************************************************************************//**\r
82  * Processes the UDP datagram.\r
83  * \r
84  * @param  buf      Pointer to the recieved buffer from Ethernet MAC.\r
85  */\r
86 unsigned char process_udp_packet (unsigned char *buf);\r
87 /***************************************************************************//**\r
88  * Sends TCP packet to the network.\r
89  * \r
90  * @param  buf      Pointer to the transmitt buffer to Ethernet MAC.\r
91  */\r
92 void send_tcp_packet (unsigned char control_bits,unsigned short int buflen);\r
93 /***************************************************************************//**\r
94  * Initialize TCP for the software TCP/IP stack.\r
95  * \r
96  * @return OK\r
97  */\r
98 unsigned char tcp_init(void);\r
99 /***************************************************************************//**\r
100  * Converts two hex decimal ascii digits into a sigle integer digit.\r
101  * \r
102  * @param       u  ascii hex digit \r
103  *                      l  ascii hex digit\r
104  * @returm      converted integer byte\r
105  * \r
106  */\r
107 unsigned char hex_digits_to_byte(unsigned char u, unsigned char l);\r
108 /***************************************************************************//**\r
109  * Processes ICMP packets\r
110  * \r
111  * @param  buf  Pointer to the recieved buffer from Ethernet MAC.\r
112  * \r
113  * @return ERR  if there is an error in the data\r
114  *                              or calls further necessary functions.\r
115  */\r
116 unsigned char process_icmp_packet(unsigned char *buf);\r
117 /***************************************************************************//**\r
118  * Sends logo of ACTEL on the network over HTTP protocol.\r
119  * @return OK\r
120  */\r
121 unsigned char http_send_logo ();\r
122 /***************************************************************************//**\r
123  * Sends appropriate answer to the different HTTP requests.\r
124  * \r
125  * @param  buf  Pointer to the recieved buffer from Ethernet MAC.\r
126  * @return OK\r
127  */\r
128 unsigned char send_http_response(unsigned char *buf);\r
129 /***************************************************************************//**\r
130  * Process incoming TCP requests and handles the TCP state machine.\r
131  * \r
132  * @param  buf  Pointer to the recieved buffer from Ethernet MAC.\r
133  * @return OK\r
134  */\r
135 unsigned char process_tcp_packet(unsigned char *buf);\r
136 /***************************************************************************//**\r
137  * Process incoming IP datagrams and handles the TCP state machine.\r
138  *  \r
139  * @param  buf  Pointer to the recieved buffer from Ethernet MAC.\r
140  * @return OK\r
141  */\r
142 unsigned char process_ip_packet(unsigned char *buf);\r
143 /***************************************************************************//**\r
144  * Processes the ARP packets. \r
145  * @param  buf  Pointer to the recieved buffer from Ethernet MAC.\r
146  * @return OK \r
147  */\r
148 unsigned char process_arp_packet(unsigned char *buf);\r
149 /***************************************************************************//**\r
150  * Processes incoming packets and identifies its type.\r
151  * \r
152  * @param  buf  Pointer to the recieved buffer from Ethernet MAC.\r
153  * @return              call the function for further process\r
154  *                 ERR   if any error\r
155  */\r
156 unsigned char process_packet( unsigned char * buf );\r
157 /***************************************************************************//**\r
158  * copies source string to destination address.\r
159  * \r
160  * @param d      Pointer to the destination\r
161  * @param s  Pointer to the source\r
162  * @return   The last location after copy\r
163  * \r
164  */\r
165 unsigned char *xstrcpy(unsigned char *d, const unsigned char *s);\r
166 /***************************************************************************//**\r
167  * Sends the home page of the demonstration webserver.\r
168  * \r
169  */\r
170 void http_send_packet();\r
171 /***************************************************************************//**\r
172  * Sends the packet for waveform mode.\r
173  * \r
174  */\r
175 void http_send_packet_waveform();\r
176 /***************************************************************************//**\r
177  *  Sends the packet for multimeter mode.\r
178  * \r
179  */\r
180 void http_send_packet_multimeter();\r
181 /***************************************************************************//**\r
182  *  Sends the packet for DAC mode.\r
183  * \r
184  */\r
185 void http_send_packet_DAC();\r
186 /***************************************************************************//**\r
187  *  Sends the packet for sleeping stopwatch.\r
188  * \r
189  */\r
190 void http_send_packet_SLEEPING_STOPWATCH();\r
191 /***************************************************************************//**\r
192  *  Sends the packet for text terminal.\r
193  * \r
194  */\r
195 void http_send_packet_textterminal();\r
196 /***************************************************************************//**\r
197  *  Sends the packet for VIT auxiliary mode.\r
198  * \r
199  */\r
200 void http_send_packet_VIT();\r
201 /***************************************************************************//**\r
202  *  Sends the packet for Real Time Data Display.\r
203  * \r
204  */\r
205 void http_send_packet_RTDD();\r
206 /***************************************************************************//**\r
207  *  Sends the packet for Stock Ticker.\r
208  * \r
209  */\r
210 void http_send_packet_Stockticker();\r
211 /***************************************************************************//**\r
212  *  Sends the packet for Gadgets mode.\r
213  * \r
214  */\r
215 void http_send_packet_weatherblog();\r
216 /***************************************************************************//**\r
217  *  Sends the packet for Selfwakeup.\r
218  * \r
219  */\r
220 void http_send_packet_SELFWAKEUP();\r
221 /***************************************************************************//**\r
222  * Same as above mentioned functions but following functions are applicable\r
223  * to Internet Explorer.\r
224  * \r
225  */\r
226 void http_send_packet_IE();\r
227 void http_send_packet_SELFWAKEUP_IE();\r
228 void http_send_packet_VIT_IE();\r
229 void http_send_packet_waveform_IE();\r
230 void http_send_packet_SLEEPING_STOPWATCH_IE();\r
231 void http_send_packet_DAC_IE();\r
232 void http_send_packet_multimeter_IE();\r
233 void http_send_packet_RTDD_IE();\r
234 #endif /*TCPIP_H_*/\r