SimpleLink CC31xx/CC32xx Host Driver  Version 3.0.1.55
Simplifies the implementation of Internet connectivity
netapp.h
1 /*
2  * netapp.h - CC31xx/CC32xx Host Driver Implementation
3  *
4  * Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com/
5  *
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * Neither the name of Texas Instruments Incorporated nor the names of
20  * its contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35 */
36 
37 
38 
39 /*****************************************************************************/
40 /* Include files */
41 /*****************************************************************************/
42 #include <ti/drivers/net/wifi/simplelink.h>
43 
44 #ifndef __NETAPP_H__
45 #define __NETAPP_H__
46 
47 
48 
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
67 /*****************************************************************************/
68 /* Macro declarations */
69 /*****************************************************************************/
70 
71 /* NetApp user events */
72 typedef enum
73 {
74  SL_NETAPP_EVENT_IPV4_ACQUIRED = 1,
75  SL_NETAPP_EVENT_IPV6_ACQUIRED,
76  SL_NETAPP_EVENT_IP_COLLISION,
77  SL_NETAPP_EVENT_DHCPV4_LEASED,
78  SL_NETAPP_EVENT_DHCPV4_RELEASED,
79  SL_NETAPP_EVENT_HTTP_TOKEN_GET,
80  SL_NETAPP_EVENT_HTTP_TOKEN_POST,
81  SL_NETAPP_EVENT_IPV4_LOST,
82  SL_NETAPP_EVENT_DHCP_IPV4_ACQUIRE_TIMEOUT,
83  SL_NETAPP_EVENT_IPV6_LOST,
84  SL_NETAPP_EVENT_NO_IPV4_COLLISION_DETECTED,
85  SL_NETAPP_EVENT_NO_LOCAL_IPV6_COLLISION_DETECTED,
86  SL_NETAPP_EVENT_NO_GLOBAL_IPV6_COLLISION_DETECTED,
87  SL_NETAPP_EVENT_MAX
88 } SlNetAppEventId_e;
89 
90 
91 #define SL_NETAPP_MDNS_OPTIONS_IS_UNIQUE_BIT 0x1
92 #define SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT ((_u32)0x1 << 31)
93 #define SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT ((_u32)0x1 << 30)
94 #define SL_NETAPP_MDNS_OPTION_UPDATE_TEXT ((_u32)0x1 << 29)
95 #define SL_NETAPP_MDNS_IPV4_ONLY_SERVICE (_u32)(0) /* default mode:zero bits 27,28*/
96 #define SL_NETAPP_MDNS_IPV6_ONLY_SERVICE ((_u32)0x1 << 28)
97 #define SL_NETAPP_MDNS_IPV6_IPV4_SERVICE ((_u32)0x1 << 27)
98 
99 
100 /*ERROR code*/
101 #define SL_NETAPP_RX_BUFFER_LENGTH_ERROR (-230)
102 
103 /* Http Server interface */
104 #define SL_NETAPP_MAX_INPUT_STRING (64) /* because of WPA */
105 
106 #define SL_NETAPP_MAX_AUTH_NAME_LEN (20)
107 #define SL_NETAPP_MAX_AUTH_PASSWORD_LEN (20)
108 #define SL_NETAPP_MAX_AUTH_REALM_LEN (20)
109 
110 #define SL_NETAPP_MAX_DEVICE_URN_LEN (32+1)
111 #define SL_NETAPP_MAX_DOMAIN_NAME_LEN (24+1)
112 
113 #define SL_NETAPP_MAX_ACTION_LEN (30)
114 #define SL_NETAPP_MAX_TOKEN_NAME_LEN (20)
115 
116 
117 #define SL_NETAPP_MAX_TOKEN_VALUE_LEN SL_NETAPP_MAX_INPUT_STRING
118 
119 #define SL_NETAPP_MAX_SERVICE_TEXT_SIZE (256)
120 #define SL_NETAPP_MAX_SERVICE_NAME_SIZE (60)
121 #define SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE (64)
122 
123 
124 /* Server Responses */
125 #define SL_NETAPP_HTTPRESPONSE_NONE (0)
126 #define SL_NETAPP_HTTPSETTOKENVALUE (1)
127 
128 #define SL_NETAPP_FAMILY_MASK (0x80)
129 
130 /* mDNS types */
131 #define SL_NETAPP_MASK_IPP_TYPE_OF_SERVICE (0x00000001)
132 #define SL_NETAPP_MASK_DEVICE_INFO_TYPE_OF_SERVICE (0x00000002)
133 #define SL_NETAPP_MASK_HTTP_TYPE_OF_SERVICE (0x00000004)
134 #define SL_NETAPP_MASK_HTTPS_TYPE_OF_SERVICE (0x00000008)
135 #define SL_NETAPP_MASK_WORKSATION_TYPE_OF_SERVICE (0x00000010)
136 #define SL_NETAPP_MASK_GUID_TYPE_OF_SERVICE (0x00000020)
137 #define SL_NETAPP_MASK_H323_TYPE_OF_SERVICE (0x00000040)
138 #define SL_NETAPP_MASK_NTP_TYPE_OF_SERVICE (0x00000080)
139 #define SL_NETAPP_MASK_OBJECITVE_TYPE_OF_SERVICE (0x00000100)
140 #define SL_NETAPP_MASK_RDP_TYPE_OF_SERVICE (0x00000200)
141 #define SL_NETAPP_MASK_REMOTE_TYPE_OF_SERVICE (0x00000400)
142 #define SL_NETAPP_MASK_RTSP_TYPE_OF_SERVICE (0x00000800)
143 #define SL_NETAPP_MASK_SIP_TYPE_OF_SERVICE (0x00001000)
144 #define SL_NETAPP_MASK_SMB_TYPE_OF_SERVICE (0x00002000)
145 #define SL_NETAPP_MASK_SOAP_TYPE_OF_SERVICE (0x00004000)
146 #define SL_NETAPP_MASK_SSH_TYPE_OF_SERVICE (0x00008000)
147 #define SL_NETAPP_MASK_TELNET_TYPE_OF_SERVICE (0x00010000)
148 #define SL_NETAPP_MASK_TFTP_TYPE_OF_SERVICE (0x00020000)
149 #define SL_NETAPP_MASK_XMPP_CLIENT_TYPE_OF_SERVICE (0x00040000)
150 #define SL_NETAPP_MASK_RAOP_TYPE_OF_SERVICE (0x00080000)
151 #define SL_NETAPP_MASK_ALL_TYPE_OF_SERVICE (0xFFFFFFFF)
152 
153 /********************************************************************************************************/
154 
155 /* NetApp application IDs */
156 #define SL_NETAPP_HTTP_SERVER_ID (0x01)
157 #define SL_NETAPP_DHCP_SERVER_ID (0x02)
158 #define SL_NETAPP_MDNS_ID (0x04)
159 #define SL_NETAPP_DNS_SERVER_ID (0x08)
160 
161 #define SL_NETAPP_DEVICE_ID (0x10)
162 #define SL_NETAPP_DNS_CLIENT_ID (0x20)
163 #define SL_NETAPP_STATUS (0x40)
164 
165 /* NetApp application set/get options */
166 #define SL_NETAPP_DHCP_SRV_BASIC_OPT (0)
167 
168 /* HTTP server set/get options */
169 #define SL_NETAPP_HTTP_PRIMARY_PORT_NUMBER (0)
170 #define SL_NETAPP_HTTP_AUTH_CHECK (1)
171 #define SL_NETAPP_HTTP_AUTH_NAME (2)
172 #define SL_NETAPP_HTTP_AUTH_PASSWORD (3)
173 #define SL_NETAPP_HTTP_AUTH_REALM (4)
174 #define SL_NETAPP_HTTP_ROM_PAGES_ACCESS (5)
175 #define SL_NETAPP_HTTP_SECONDARY_PORT_NUMBER (6)
176 #define SL_NETAPP_HTTP_SECONDARY_PORT_ENABLE (7) /*Enable / disable of secondary port */
177 #define SL_NETAPP_HTTP_PRIMARY_PORT_SECURITY_MODE (8)
178 #define SL_NETAPP_HTTP_PRIVATE_KEY_FILENAME (9)
179 #define SL_NETAPP_HTTP_DEVICE_CERTIFICATE_FILENAME (10)
180 #define SL_NETAPP_HTTP_CA_CERTIFICATE_FILE_NAME (11)
181 #define SL_NETAPP_HTTP_TEMP_REGISTER_MDNS_SERVICE_NAME (12)
182 #define SL_NETAPP_HTTP_TEMP_UNREGISTER_MDNS_SERVICE_NAME (13)
183 #define SL_NETAPP_HTTP_TIMEOUT (14)
184 
185 
186 #define SL_NETAPP_MDNS_CONT_QUERY_OPT (1)
187 #define SL_NETAPP_MDNS_QEVETN_MASK_OPT (2)
188 #define SL_NETAPP_MDNS_TIMING_PARAMS_OPT (3)
189 
190 /* DNS server set/get options */
191 #define SL_NETAPP_DNS_OPT_DOMAIN_NAME (0)
192 
193 /* Device Config set/get options */
194 #define SL_NETAPP_DEVICE_URN (0)
195 #define SL_NETAPP_DEVICE_DOMAIN (1)
196 #define SL_NETAPP_DEVICE_NAME (2)
197 
198 /* DNS client set/get options */
199 #define SL_NETAPP_DNS_CLIENT_TIME (0)
200 #define SL_NETAPP_DNS_CLIENT_CACHE_CLEAR (1)
201 #define SL_NETAPP_DNS_CLIENT_CACHE_ENABLE (2)
202 
203 /* Get active application bimap */
204 #define SL_NETAPP_STATUS_ACTIVE_APP (0)
205 
206 #define SL_NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH (255)
207 
208 
209 /*****************************************************************************/
210 /* Structure/Enum declarations */
211 /*****************************************************************************/
212 
213 typedef struct
214 {
215  _u32 Ip;
216  _u32 Gateway;
217  _u32 Dns;
219 
220 typedef enum
221 {
222  SL_BSD_IPV6_ACQUIRED_TYPE_LOCAL = 1,
223  SL_BSD_IPV6_ACQUIRED_TYPE_GLOBAL = 2
224 }SlIpV6AcquiredAsyncType_e;
225 
226 typedef struct
227 {
228  _u32 Ip[4];
229  _u32 Dns[4];
231 
232 typedef struct
233 {
234  _u32 IpAddress;
235  _u32 LeaseTime;
236  _u8 Mac[6];
237  _u16 Padding;
239 
240 typedef struct
241 {
242  _u32 IpAddress;
243  _u8 Mac[6];
244  _u16 Reason;
246 
247 typedef struct
248 {
249  _u32 IpAddress;
250  _u8 DhcpMac[6];
251  _u8 ConflictMac[6];
253 
254 typedef struct
255 {
256  _u32 Ip;
257  _u8 Mac[6];
258  _u16 AddMode;
260 
261 typedef struct
262 {
263  _u32 Ip[4];
264  _u8 Mac[6];
265  _u16 AddMode;
267 
268 
269 
270 typedef struct
271 {
272  _i16 Status;
273  _u16 Padding;
274 }SlIpV4Lost_t;
275 
276 typedef struct
277 {
278  _u32 IpLost[4];
279 }SlIpV6Lost_t;
280 
281 typedef struct
282 {
283  _i16 Status;
284  _u16 Padding;
286 
287 typedef union
288 {
289  SlIpV4AcquiredAsync_t IpAcquiredV4; /* SL_NETAPP_EVENT_IPV4_ACQUIRED */
290  SlIpV6AcquiredAsync_t IpAcquiredV6; /* SL_NETAPP_EVENT_IPV6_ACQUIRED */
291  _u32 Sd; /* SL_SOCKET_TX_FAILED_EVENT */
292  SlIpLeasedAsync_t IpLeased; /* SL_NETAPP_EVENT_DHCPV4_LEASED */
293  SlIpReleasedAsync_t IpReleased; /* SL_NETAPP_EVENT_DHCPV4_RELEASED */
294  SlIpV4Lost_t IpV4Lost; /* SL_NETAPP_EVENT_IPV4_LOST */
295  SlDhcpIpAcquireTimeout_t DhcpIpAcquireTimeout; /* SL_NETAPP_DHCP_ACQUIRE_IPV4_TIMEOUT_EVENT */
296  SlIpCollisionAsync_t IpCollision; /* SL_NETAPP_EVENT_IP_COLLISION */
297  SlIpV6Lost_t IpV6Lost; /* SL_NETAPP_EVENT_IPV6_LOST */
298  SlNoIpV4CollisionDetectedAsync_t Ipv4CollisionDetected; /* SL_NETAPP_EVENT_NO_IPV4_COLLISION_DETECTED */
299  SlNoIpV6CollisionDetectedAsync_t Ipv6CollisionDetected; /* SL_NETAPP_EVENT_NO_IPV4_COLLISION_DETECTED */
301 
302 typedef struct
303 {
304  _u32 Id;
305  SlNetAppEventData_u Data;
307 
308 typedef struct
309 {
310  _u32 PacketsSent;
311  _u32 PacketsReceived;
312  _u16 MinRoundTime;
313  _u16 MaxRoundTime;
314  _u16 AvgRoundTime;
315  _u32 TestTime;
317 
318 typedef struct
319 {
320  _u32 PingIntervalTime; /* delay between pings, in milliseconds */
321  _u16 PingSize; /* ping packet size in bytes */
322  _u16 PingRequestTimeout; /* timeout time for every ping in milliseconds */
323  _u32 TotalNumberOfAttempts; /* max number of ping requests. 0 - forever */
324  _u32 Flags; /* flag - 0 report only when finished, 1 - return response for every ping, 2 - stop after 1 successful ping. 4 - ipv4 header flag - don`t fragment packet */
325  _u32 Ip; /* IPv4 address or IPv6 first 4 bytes */
326  _u32 Ip1OrPadding;
327  _u32 Ip2OrPadding;
328  _u32 Ip3OrPadding;
330 
331 typedef struct
332 {
333  _u8 Len;
334  _u8 *pData;
336 
337 typedef struct
338 {
339  _u8 ValueLen;
340  _u8 NameLen;
341  _u8 *pTokenValue;
342  _u8 *pTokenName;
344 
345 typedef struct
346 {
348  SlNetAppHttpServerString_t TokenName;
349  SlNetAppHttpServerString_t TokenValue;
351 
352 typedef union
353 {
354  SlNetAppHttpServerString_t HttpTokenName; /* SL_NETAPP_HTTPGETTOKENVALUE */
355  SlNetAppHttpServerPostData_t HttpPostData; /* SL_NETAPP_HTTPPOSTTOKENVALUE */
357 
358 typedef union
359 {
360  SlNetAppHttpServerString_t TokenValue;
362 
363 typedef struct
364 {
365  _u32 Event;
368 
369 typedef struct
370 {
371  _u32 Response;
374 
375 /*****************************************************************************************
376 * NETAPP Request/Response/Send/Receive
377 ******************************************************************************************/
378 /* TODO: check what definitions are eventually needed */
379 /* NETAPP http request types */
380 #define SL_NETAPP_REQUEST_HTTP_GET 1
381 #define SL_NETAPP_REQUEST_HTTP_POST 2
382 #define SL_NETAPP_REQUEST_HTTP_PUT 3
383 #define SL_NETAPP_REQUEST_HTTP_DELETE 4
384 
385 #define SL_NETAPP_REQUEST_MAX_METADATA_LEN 1024
386 #define SL_NETAPP_REQUEST_MAX_DATA_LEN 1364 /* Metadata + Payload */
387 
388 
389 typedef enum
390 {
391  SL_NETAPP_REQUEST_METADATA_TYPE_STATUS = 0,
392  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_VERSION,
393  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REQUEST_URI,
394  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_QUERY_STRING,
395  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_LEN,
396  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_TYPE,
397  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_LOCATION,
398  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_SERVER,
399  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_USER_AGENT,
400  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_COOKIE,
401  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_SET_COOKIE,
402  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_UPGRADE,
403  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REFERER,
404  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_ACCEPT,
405  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_ENCODING,
406  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_DISPOSITION,
407  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONNECTION,
408  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_ETAG,
409  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_DATE,
410  SL_NETAPP_REQUEST_METADATA_TYPE_HEADER_HOST,
411  SL_NETAPP_REQUEST_METADATA_TYPE_ACCEPT_ENCODING,
412  SL_NETAPP_REQUEST_METADATA_TYPE_ACCEPT_LANGUAGE,
413  SL_NETAPP_REQUEST_METADATA_TYPE_CONTENT_LANGUAGE,
414  SL_NETAPP_REQUEST_METADATA_TYPE_ORIGIN,
415  SL_NETAPP_REQUEST_METADATA_TYPE_ORIGIN_CONTROL_ACCESS,
416  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_NONE
417 } SlNetAppMetadataHTTPTypes_e;
418 
419 typedef enum
420 {
421  SL_NETAPP_RESPONSE_NONE = 0, /* No response */
422  SL_NETAPP_RESPONSE_PENDING = 1, /* status will arrive in future NetApp Send call (in metadata) */
423 
424  SL_NETAPP_HTTP_RESPONSE_101_SWITCHING_PROTOCOLS = 101, /* 101 Switching Protocol*/
425  SL_NETAPP_HTTP_RESPONSE_200_OK = 200, /* 200 OK */
426  SL_NETAPP_HTTP_RESPONSE_201_CREATED = 201, /* "HTTP/1.0 201 Created" */
427  SL_NETAPP_HTTP_RESPONSE_202_ACCEPTED = 202, /* "HTTP/1.0 202 Accepted" */
428  SL_NETAPP_HTTP_RESPONSE_204_OK_NO_CONTENT = 204, /* 204 No Content */
429  SL_NETAPP_HTTP_RESPONSE_301_MOVED_PERMANENTLY = 301, /* "HTTP/1.0 301 Moved Permanently" */
430  SL_NETAPP_HTTP_RESPONSE_302_MOVED_TEMPORARILY = 302, /* 302 Moved Temporarily (http 1.0) */
431  SL_NETAPP_HTTP_RESPONSE_303_SEE_OTHER = 303, /* "HTTP/1.1 303 See Other" */
432  SL_NETAPP_HTTP_RESPONSE_304_NOT_MODIFIED = 304, /* "HTTP/1.0 304 Not Modified" */
433  SL_NETAPP_HTTP_RESPONSE_400_BAD_REQUEST = 400, /* "HTTP/1.0 400 Bad Request" */
434  SL_NETAPP_HTTP_RESPONSE_403_FORBIDDEN = 403, /* "HTTP/1.0 403 Forbidden" */
435  SL_NETAPP_HTTP_RESPONSE_404_NOT_FOUND = 404, /* 404 Not Found */
436  SL_NETAPP_HTTP_RESPONSE_405_METHOD_NOT_ALLOWED = 405, /* "HTTP/1.0 405 Method Not Allowed" */
437  SL_NETAPP_HTTP_RESPONSE_500_INTERNAL_SERVER_ERROR = 500, /* 500 Internal Server Error */
438  SL_NETAPP_HTTP_RESPONSE_503_SERVICE_UNAVAILABLE = 503, /* "HTTP/1.0 503 Service Unavailable" */
439  SL_NETAPP_HTTP_RESPONSE_504_GATEWAY_TIMEOUT = 504 /* "HTTP/1.0 504 Gateway Timeout" */
440 } SlNetAppResponseCode_e;
441 
442 
443 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION 0x00000001
444 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA 0x00000002 /* 0 - data is payload, 1 - data is metadata */
445 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_ACCUMULATION 0x00000004
446 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_ERROR 0x80000000 /* in that case the last two bytes represents the error code */
447 
448 typedef struct
449 {
450  _u16 MetadataLen;
451  _u8 *pMetadata;
452  _u16 PayloadLen;
453  _u8 *pPayload;
454  _u32 Flags;
456 
457 typedef struct
458 {
459  _u8 AppId;
460  _u8 Type;
461  _u16 Handle;
462  SlNetAppData_t requestData;
464 
465 typedef struct
466 {
467  _u16 Status;
468  SlNetAppData_t ResponseData;
470 
471 typedef struct
472 {
473  _u32 lease_time;
474  _u32 ipv4_addr_start;
475  _u32 ipv4_addr_last;
477 
478 /* mDNS parameters */
479 typedef enum
480 {
481  SL_NETAPP_FULL_SERVICE_WITH_TEXT_IPV4_TYPE = 1,
482  SL_NETAPP_FULL_SERVICE_IPV4_TYPE,
483  SL_NETAPP_SHORT_SERVICE_IPV4_TYPE,
484  SL_NETAPP_FULL_SERVICE_WITH_TEXT_IPV6_TYPE ,
485  SL_NETAPP_FULL_SERVICE_IPV6_TYPE,
486  SL_NETAPP_SHORT_SERVICE_IPV6_TYPE
487 } SlNetAppGetServiceListType_e;
488 
489 typedef struct
490 {
491  _u32 service_ipv4;
492  _u16 service_port;
493  _u16 Reserved;
495 
496 typedef struct
497 {
498  _u32 service_ipv4;
499  _u16 service_port;
500  _u16 Reserved;
501  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
502  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
504 
505 typedef struct
506 {
507  _u32 service_ipv4;
508  _u16 service_port;
509  _u16 Reserved;
510  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
511  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
512  _u8 service_text[SL_NETAPP_MAX_SERVICE_TEXT_SIZE];
514 
515 /* IPv6 entries */
516 typedef struct
517 {
518  _u32 service_ipv6[4];
519  _u16 service_port;
520  _u16 Reserved;
522 
523 typedef struct
524 {
525  _u32 service_ipv6[4];
526  _u16 service_port;
527  _u16 Reserved;
528  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
529  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
531 
532 typedef struct
533 {
534  _u32 service_ipv6[4];
535  _u16 service_port;
536  _u16 Reserved;
537  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
538  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
539  _u8 service_text[SL_NETAPP_MAX_SERVICE_TEXT_SIZE];
541 
542 typedef struct
543 {
544  /*The below parameters are used to configure the advertise times and interval
545  For example:
546  If:
547  Period is set to T
548  Repetitions are set to P
549  Telescopic factor is K=2
550  The transmission shall be:
551  advertise P times
552  wait T
553  advertise P times
554  wait 4 * T
555  advertise P time
556  wait 16 * T ... (till max time reached / configuration changed / query issued)
557  */
558  _u32 t; /* Number of ticks for the initial period. Default is 100 ticks for 1 second. */
559  _u32 p; /* Number of repetitions. Default value is 1 */
560  _u32 k; /* Telescopic factor. Default value is 2. */
561  _u32 RetransInterval; /* Announcing retransmission interval */
562  _u32 Maxinterval; /* Announcing max period interval */
563  _u32 max_time; /* Announcing max time */
565 
566 typedef struct
567 {
568  _u16 MaxResponseTime;
569  _u16 NumOfRetries;
571 
572 /*****************************************************************************/
573 /* Types declarations */
574 /*****************************************************************************/
575 typedef void (*P_SL_DEV_PING_CALLBACK)(SlNetAppPingReport_t*);
576 
577 /*****************************************************************************/
578 /* Function prototypes */
579 /*****************************************************************************/
580 
581 
606 #if _SL_INCLUDE_FUNC(sl_NetAppStart)
607 _i16 sl_NetAppStart(const _u32 AppBitMap);
608 #endif
609 
634 #if _SL_INCLUDE_FUNC(sl_NetAppStop)
635 _i16 sl_NetAppStop(const _u32 AppBitMap);
636 #endif
637 
658 #if _SL_INCLUDE_FUNC(sl_NetAppArpFlush)
659 _i16 sl_NetAppArpFlush();
660 #endif
661 
682 #if _SL_INCLUDE_FUNC(sl_NetAppNdFlush)
683 _i16 sl_NetAppNdFlush();
684 #endif
685 
736 #if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByName)
737 _i16 sl_NetAppDnsGetHostByName(_i8 * pHostName,const _u16 NameLen, _u32* OutIpAddr,const _u8 Family );
738 #endif
739 
793 #if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByService)
794 _i16 sl_NetAppDnsGetHostByService(_i8 *pServiceName, /* string containing all (or only part): name + subtype + service */
795  const _u8 ServiceLen,
796  const _u8 Family, /* 4-IPv4 , 16-IPv6 */
797  _u32 pAddr[],
798  _u32 *pPort,
799  _u16 *pTextLen, /* in: max len , out: actual len */
800  _i8 *pText
801  );
802 
803 #endif
804 
855 #if _SL_INCLUDE_FUNC(sl_NetAppGetServiceList)
856 _i16 sl_NetAppGetServiceList(const _u8 IndexOffset,
857  const _u8 MaxServiceCount,
858  const _u8 Flags,
859  _i8 *pBuffer,
860  const _u32 BufferLength
861  );
862 
863 #endif
864 
894 #if _SL_INCLUDE_FUNC(sl_NetAppMDNSUnRegisterService)
895 _i16 sl_NetAppMDNSUnRegisterService(const _i8 *pServiceName,const _u8 ServiceNameLen,_u32 Options);
896 #endif
897 
963 #if _SL_INCLUDE_FUNC(sl_NetAppMDNSRegisterService)
964 _i16 sl_NetAppMDNSRegisterService( const _i8* pServiceName,
965  const _u8 ServiceNameLen,
966  const _i8* pText,
967  const _u8 TextLen,
968  const _u16 Port,
969  const _u32 TTL,
970  _u32 Options);
971 #endif
972 
1036 #if _SL_INCLUDE_FUNC(sl_NetAppPing)
1037 _i16 sl_NetAppPing(const SlNetAppPingCommand_t* pPingParams,const _u8 Family, SlNetAppPingReport_t *pReport, const P_SL_DEV_PING_CALLBACK pPingCallback);
1038 #endif
1039 
1257 #if _SL_INCLUDE_FUNC(sl_NetAppSet)
1258 _i16 sl_NetAppSet(const _u8 AppId ,const _u8 Option,const _u8 OptionLen,const _u8 *pOptionValue);
1259 #endif
1260 
1365 #if _SL_INCLUDE_FUNC(sl_NetAppGet)
1366 _i16 sl_NetAppGet(const _u8 AppId, const _u8 Option,_u8 *pOptionLen, _u8 *pOptionValue);
1367 #endif
1368 
1387 #if _SL_INCLUDE_FUNC(sl_NetAppSend)
1388 _u16 sl_NetAppSend( _u16 Handle, _u16 DataLen, _u8 *pData, _u32 Flags);
1389 #endif
1390 
1407 #if _SL_INCLUDE_FUNC(sl_NetAppRecv)
1408 _SlReturnVal_t sl_NetAppRecv( _u16 Handle, _u16 *DataLen, _u8 *pData, _u32 *Flags);
1409 #endif
1410 
1419 #ifdef __cplusplus
1420 }
1421 #endif /* __cplusplus */
1422 
1423 #endif /* __NETAPP_H__ */
1424 
_i16 sl_NetAppArpFlush()
Flush IPv4 ARP table.
Definition: netapp.c:151
Definition: netapp.h:345
_i16 sl_NetAppSet(const _u8 AppId, const _u8 Option, const _u8 OptionLen, const _u8 *pOptionValue)
Setting network application configurations.
Definition: netapp.c:1136
_i16 sl_NetAppMDNSUnRegisterService(const _i8 *pServiceName, const _u8 ServiceNameLen, _u32 Options)
Unregister mDNS service This function deletes the mDNS service from the mDNS package and the database...
Definition: netapp.c:502
_SlReturnVal_t sl_NetAppRecv(_u16 Handle, _u16 *DataLen, _u8 *pData, _u32 *Flags)
Function for retrieving data from the network processor following a Netapp request event (i...
Definition: netapp.c:1276
_i16 sl_NetAppDnsGetHostByService(_i8 *pServiceName, const _u8 ServiceLen, const _u8 Family, _u32 pAddr[], _u32 *pPort, _u16 *pTextLen, _i8 *pText)
Return service attributes like IP address, port and text according to service name The user sets a s...
Definition: netapp.c:613
_i16 sl_NetAppDnsGetHostByName(_i8 *pHostName, const _u16 NameLen, _u32 *OutIpAddr, const _u8 Family)
Get host IP by name Obtain the IP Address of machine on network, by machine name. ...
Definition: netapp.c:849
_i16 sl_NetAppPing(const SlNetAppPingCommand_t *pPingParams, const _u8 Family, SlNetAppPingReport_t *pReport, const P_SL_DEV_PING_CALLBACK pPingCallback)
send ICMP ECHO_REQUEST to network hosts
Definition: netapp.c:1003
_i16 sl_NetAppStart(const _u32 AppBitMap)
Starts a network application.
Definition: netapp.c:103
_i16 sl_NetAppMDNSRegisterService(const _i8 *pServiceName, const _u8 ServiceNameLen, const _i8 *pText, const _u8 TextLen, const _u16 Port, const _u32 TTL, _u32 Options)
Register a new mDNS service This function registers a new mDNS service to the mDNS package and the D...
Definition: netapp.c:453
_i16 sl_NetAppNdFlush()
Flush IPv6 Neighbor Discovery table.
Definition: netapp.c:168
_i16 sl_NetAppGetServiceList(const _u8 IndexOffset, const _u8 MaxServiceCount, const _u8 Flags, _i8 *pBuffer, const _u32 BufferLength)
Get service list Insert into out pBuffer a list of peer&#39;s services that are in the NWP without issui...
Definition: netapp.c:205
_i16 sl_NetAppStop(const _u32 AppBitMap)
Stops a network application.
Definition: netapp.c:129
_u16 sl_NetAppSend(_u16 Handle, _u16 DataLen, _u8 *pData, _u32 Flags)
Function for sending Netapp response or data following a Netapp request event (i.e. HTTP GET request)
Definition: netapp.c:1412
_i16 sl_NetAppGet(const _u8 AppId, const _u8 Option, _u8 *pOptionLen, _u8 *pOptionValue)
Getting network applications configurations.
Definition: netapp.c:1456