SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.22
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_MAX
85 } SlNetAppEventId_e;
86 
87 
88 #define SL_NETAPP_MDNS_OPTIONS_IS_UNIQUE_BIT 0x1
89 #define SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT ((_u32)0x1 << 31)
90 #define SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT ((_u32)0x1 << 30)
91 #define SL_NETAPP_MDNS_OPTION_UPDATE_TEXT ((_u32)0x1 << 29)
92 #define SL_NETAPP_MDNS_IPV4_ONLY_SERVICE (_u32)(0) /* default mode:zero bits 27,28*/
93 #define SL_NETAPP_MDNS_IPV6_ONLY_SERVICE ((_u32)0x1 << 28)
94 #define SL_NETAPP_MDNS_IPV6_IPV4_SERVICE ((_u32)0x1 << 27)
95 
96 
97 /*ERROR code*/
98 #define SL_NETAPP_RX_BUFFER_LENGTH_ERROR (-230)
99 
100 /* Http Server interface */
101 #define SL_NETAPP_MAX_INPUT_STRING (64) /* because of WPA */
102 
103 #define SL_NETAPP_MAX_AUTH_NAME_LEN (20)
104 #define SL_NETAPP_MAX_AUTH_PASSWORD_LEN (20)
105 #define SL_NETAPP_MAX_AUTH_REALM_LEN (20)
106 
107 #define SL_NETAPP_MAX_DEVICE_URN_LEN (32+1)
108 #define SL_NETAPP_MAX_DOMAIN_NAME_LEN (24+1)
109 
110 #define SL_NETAPP_MAX_ACTION_LEN (30)
111 #define SL_NETAPP_MAX_TOKEN_NAME_LEN (20)
112 
113 
114 #define SL_NETAPP_MAX_TOKEN_VALUE_LEN SL_NETAPP_MAX_INPUT_STRING
115 
116 #define SL_NETAPP_MAX_SERVICE_TEXT_SIZE (256)
117 #define SL_NETAPP_MAX_SERVICE_NAME_SIZE (60)
118 #define SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE (64)
119 
120 
121 /* Server Responses */
122 #define SL_NETAPP_HTTPRESPONSE_NONE (0)
123 #define SL_NETAPP_HTTPSETTOKENVALUE (1)
124 
125 #define SL_NETAPP_FAMILY_MASK (0x80)
126 
127 /* mDNS types */
128 #define SL_NETAPP_MASK_IPP_TYPE_OF_SERVICE (0x00000001)
129 #define SL_NETAPP_MASK_DEVICE_INFO_TYPE_OF_SERVICE (0x00000002)
130 #define SL_NETAPP_MASK_HTTP_TYPE_OF_SERVICE (0x00000004)
131 #define SL_NETAPP_MASK_HTTPS_TYPE_OF_SERVICE (0x00000008)
132 #define SL_NETAPP_MASK_WORKSATION_TYPE_OF_SERVICE (0x00000010)
133 #define SL_NETAPP_MASK_GUID_TYPE_OF_SERVICE (0x00000020)
134 #define SL_NETAPP_MASK_H323_TYPE_OF_SERVICE (0x00000040)
135 #define SL_NETAPP_MASK_NTP_TYPE_OF_SERVICE (0x00000080)
136 #define SL_NETAPP_MASK_OBJECITVE_TYPE_OF_SERVICE (0x00000100)
137 #define SL_NETAPP_MASK_RDP_TYPE_OF_SERVICE (0x00000200)
138 #define SL_NETAPP_MASK_REMOTE_TYPE_OF_SERVICE (0x00000400)
139 #define SL_NETAPP_MASK_RTSP_TYPE_OF_SERVICE (0x00000800)
140 #define SL_NETAPP_MASK_SIP_TYPE_OF_SERVICE (0x00001000)
141 #define SL_NETAPP_MASK_SMB_TYPE_OF_SERVICE (0x00002000)
142 #define SL_NETAPP_MASK_SOAP_TYPE_OF_SERVICE (0x00004000)
143 #define SL_NETAPP_MASK_SSH_TYPE_OF_SERVICE (0x00008000)
144 #define SL_NETAPP_MASK_TELNET_TYPE_OF_SERVICE (0x00010000)
145 #define SL_NETAPP_MASK_TFTP_TYPE_OF_SERVICE (0x00020000)
146 #define SL_NETAPP_MASK_XMPP_CLIENT_TYPE_OF_SERVICE (0x00040000)
147 #define SL_NETAPP_MASK_RAOP_TYPE_OF_SERVICE (0x00080000)
148 #define SL_NETAPP_MASK_ALL_TYPE_OF_SERVICE (0xFFFFFFFF)
149 
150 /********************************************************************************************************/
151 
152 /* NetApp application IDs */
153 #define SL_NETAPP_HTTP_SERVER_ID (0x01)
154 #define SL_NETAPP_DHCP_SERVER_ID (0x02)
155 #define SL_NETAPP_MDNS_ID (0x04)
156 #define SL_NETAPP_DNS_SERVER_ID (0x08)
157 
158 #define SL_NETAPP_DEVICE_ID (0x10)
159 #define SL_NETAPP_DNS_CLIENT_ID (0x20)
160 #define SL_NETAPP_STATUS (0x40)
161 
162 /* NetApp application set/get options */
163 #define SL_NETAPP_DHCP_SRV_BASIC_OPT (0)
164 
165 /* HTTP server set/get options */
166 #define SL_NETAPP_HTTP_PRIMARY_PORT_NUMBER (0)
167 #define SL_NETAPP_HTTP_AUTH_CHECK (1)
168 #define SL_NETAPP_HTTP_AUTH_NAME (2)
169 #define SL_NETAPP_HTTP_AUTH_PASSWORD (3)
170 #define SL_NETAPP_HTTP_AUTH_REALM (4)
171 #define SL_NETAPP_HTTP_ROM_PAGES_ACCESS (5)
172 #define SL_NETAPP_HTTP_SECONDARY_PORT_NUMBER (6)
173 #define SL_NETAPP_HTTP_SECONDARY_PORT_ENABLE (7) /*Enable / disable of secondary port */
174 #define SL_NETAPP_HTTP_PRIMARY_PORT_SECURITY_MODE (8)
175 #define SL_NETAPP_HTTP_PRIVATE_KEY_FILENAME (9)
176 #define SL_NETAPP_HTTP_DEVICE_CERTIFICATE_FILENAME (10)
177 #define SL_NETAPP_HTTP_CA_CERTIFICATE_FILE_NAME (11)
178 #define SL_NETAPP_HTTP_TEMP_REGISTER_MDNS_SERVICE_NAME (12)
179 #define SL_NETAPP_HTTP_TEMP_UNREGISTER_MDNS_SERVICE_NAME (13)
180 
181 #define SL_NETAPP_MDNS_CONT_QUERY_OPT (1)
182 #define SL_NETAPP_MDNS_QEVETN_MASK_OPT (2)
183 #define SL_NETAPP_MDNS_TIMING_PARAMS_OPT (3)
184 
185 /* DNS server set/get options */
186 #define SL_NETAPP_DNS_OPT_DOMAIN_NAME (0)
187 
188 /* Device Config set/get options */
189 #define SL_NETAPP_DEVICE_URN (0)
190 #define SL_NETAPP_DEVICE_DOMAIN (1)
191 
192 /* DNS client set/get options */
193 #define SL_NETAPP_DNS_CLIENT_TIME (0)
194 
195 /* Get active application bimap */
196 #define SL_NETAPP_STATUS_ACTIVE_APP (0)
197 
198 #ifdef SL_TINY
199 #define SL_NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH 63
200 #else
201 #define SL_NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH 255
202 #endif
203 
204 /*****************************************************************************/
205 /* Structure/Enum declarations */
206 /*****************************************************************************/
207 
208 
209 typedef struct
210 {
211  _u32 Ip;
212  _u32 Gateway;
213  _u32 Dns;
215 
216 typedef enum
217 {
218  SL_BSD_IPV6_ACQUIRED_TYPE_LOCAL = 1,
219  SL_BSD_IPV6_ACQUIRED_TYPE_GLOBAL = 2
220 }SlIpV6AcquiredAsyncType_e;
221 
222 
223 typedef struct
224 {
225  _u32 Ip[4];
226  _u32 Dns[4];
228 
229 typedef struct
230 {
231  _u32 IpAddress;
232  _u32 LeaseTime;
233  _u8 Mac[6];
234  _u16 Padding;
236 
237 typedef struct
238 {
239  _u32 IpAddress;
240  _u8 Mac[6];
241  _u16 Reason;
243 
244 typedef struct
245 {
246  _u32 IpAddress;
247  _u8 DhcpMac[6];
248  _u8 ConflictMac[6];
250 
251 typedef struct
252 {
253  _i16 Status;
254  _u16 Padding;
255 }SlIpV4Lost_t;
256 
257 typedef struct
258 {
259  _u32 IpLost[4];
260 }SlIpV6Lost_t;
261 
262 typedef struct
263 {
264  _i16 Status;
265  _u16 Padding;
267 
268 
269 typedef union
270 {
271  SlIpV4AcquiredAsync_t IpAcquiredV4; /* SL_NETAPP_EVENT_IPV4_ACQUIRED */
272  SlIpV6AcquiredAsync_t IpAcquiredV6; /* SL_NETAPP_EVENT_IPV6_ACQUIRED */
273  _u32 Sd; /* SL_SOCKET_TX_FAILED_EVENT*/
274  SlIpLeasedAsync_t IpLeased; /* SL_NETAPP_EVENT_DHCPV4_LEASED */
275  SlIpReleasedAsync_t IpReleased; /* SL_NETAPP_EVENT_DHCPV4_RELEASED */
276  SlIpV4Lost_t IpV4Lost; /* SL_NETAPP_EVENT_IPV4_LOST */
277  SlDhcpIpAcquireTimeout_t DhcpIpAcquireTimeout; /* SL_NETAPP_DHCP_ACQUIRE_IPV4_TIMEOUT_EVENT */
278  SlIpCollisionAsync_t IpCollision; /* SL_NETAPP_EVENT_IP_COLLISION */
279  SlIpV6Lost_t IpV6Lost; /* SL_NETAPP_EVENT_IPV6_LOST */
281 
282 typedef struct
283 {
284  _u32 Id;
285  SlNetAppEventData_u Data;
287 
288 
289 typedef struct
290 {
291  _u32 PacketsSent;
292  _u32 PacketsReceived;
293  _u16 MinRoundTime;
294  _u16 MaxRoundTime;
295  _u16 AvgRoundTime;
296  _u32 TestTime;
298 
299 typedef struct
300 {
301  _u32 PingIntervalTime; /* delay between pings, in milliseconds */
302  _u16 PingSize; /* ping packet size in bytes */
303  _u16 PingRequestTimeout; /* timeout time for every ping in milliseconds */
304  _u32 TotalNumberOfAttempts; /* max number of ping requests. 0 - forever */
305  _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 */
306  _u32 Ip; /* IPv4 address or IPv6 first 4 bytes */
307  _u32 Ip1OrPadding;
308  _u32 Ip2OrPadding;
309  _u32 Ip3OrPadding;
311 
312 typedef struct
313 {
314  _u8 Len;
315  _u8 *pData;
317 
318 typedef struct
319 {
320  _u8 ValueLen;
321  _u8 NameLen;
322  _u8 *pTokenValue;
323  _u8 *pTokenName;
325 
326 typedef struct
327 {
329  SlNetAppHttpServerString_t TokenName;
330  SlNetAppHttpServerString_t TokenValue;
332 
333 typedef union
334 {
335  SlNetAppHttpServerString_t HttpTokenName; /* SL_NETAPP_HTTPGETTOKENVALUE */
336  SlNetAppHttpServerPostData_t HttpPostData; /* SL_NETAPP_HTTPPOSTTOKENVALUE */
338 
339 typedef union
340 {
341  SlNetAppHttpServerString_t TokenValue;
343 
344 typedef struct
345 {
346  _u32 Event;
349 
350 typedef struct
351 {
352  _u32 Response;
355 
356 /*****************************************************************************************
357 * NETAPP Request/Response/Send/Receive
358 ******************************************************************************************/
359 /* TODO: check what definitions are eventually needed */
360 /* NETAPP http request types */
361 #define SL_NETAPP_REQUEST_HTTP_GET 1
362 #define SL_NETAPP_REQUEST_HTTP_POST 2
363 #define SL_NETAPP_REQUEST_HTTP_PUT 3
364 #define SL_NETAPP_REQUEST_HTTP_DELETE 4
365 
366 #define SL_NETAPP_REQUEST_MAX_METADATA_LEN 1024
367 #define SL_NETAPP_REQUEST_MAX_DATA_LEN 1364 /* Metadata + Payload */
368 
369 
370 typedef enum
371 {
372  SL_NETAPP_REQUEST_METADATA_TYPE_STATUS = 0,
373  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_VERSION,
374  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REQUEST_URI,
375  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_QUERY_STRING,
376  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_LEN,
377  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_TYPE,
378  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_LOCATION,
379  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_SERVER,
380  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_USER_AGENT,
381  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_COOKIE,
382  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_SET_COOKIE,
383  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_UPGRADE,
384  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REFERER,
385  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_ACCEPT,
386  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_ENCODING,
387  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_DISPOSITION,
388  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONNECTION,
389  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_ETAG,
390  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_DATE,
391  SL_NETAPP_REQUEST_METADATA_TYPE_HEADER_HOST,
392  SL_NETAPP_REQUEST_METADATA_TYPE_ACCEPT_ENCODING,
393  SL_NETAPP_REQUEST_METADATA_TYPE_ACCEPT_LANGUAGE,
394  SL_NETAPP_REQUEST_METADATA_TYPE_CONTENT_LANGUAGE,
395  SL_NETAPP_REQUEST_METADATA_TYPE_ORIGIN,
396  SL_NETAPP_REQUEST_METADATA_TYPE_ORIGIN_CONTROL_ACCESS,
397  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_NONE
398 
399 } SlNetAppMetadataHTTPTypes_e;
400 
401 typedef enum
402 {
403  SL_NETAPP_RESPONSE_NONE = 0, /* No response */
404  SL_NETAPP_RESPONSE_PENDING = 1, /* status will arrive in future NetApp Send call (in metadata) */
405 
406  SL_NETAPP_HTTP_RESPONSE_101_SWITCHING_PROTOCOLS = 101, /* 101 Switching Protocol*/
407  SL_NETAPP_HTTP_RESPONSE_200_OK = 200, /* 200 OK */
408  SL_NETAPP_HTTP_RESPONSE_201_CREATED = 201, /* "HTTP/1.0 201 Created" */
409  SL_NETAPP_HTTP_RESPONSE_202_ACCEPTED = 202, /* "HTTP/1.0 202 Accepted" */
410  SL_NETAPP_HTTP_RESPONSE_204_OK_NO_CONTENT = 204, /* 204 No Content */
411  SL_NETAPP_HTTP_RESPONSE_301_MOVED_PERMANENTLY = 301, /* "HTTP/1.0 301 Moved Permanently" */
412  SL_NETAPP_HTTP_RESPONSE_302_MOVED_TEMPORARILY = 302, /* 302 Moved Temporarily (http 1.0) */
413  SL_NETAPP_HTTP_RESPONSE_303_SEE_OTHER = 303, /* "HTTP/1.1 303 See Other" */
414  SL_NETAPP_HTTP_RESPONSE_304_NOT_MODIFIED = 304, /* "HTTP/1.0 304 Not Modified" */
415  SL_NETAPP_HTTP_RESPONSE_400_BAD_REQUEST = 400, /* "HTTP/1.0 400 Bad Request" */
416  SL_NETAPP_HTTP_RESPONSE_403_FORBIDDEN = 403, /* "HTTP/1.0 403 Forbidden" */
417  SL_NETAPP_HTTP_RESPONSE_404_NOT_FOUND = 404, /* 404 Not Found */
418  SL_NETAPP_HTTP_RESPONSE_405_METHOD_NOT_ALLOWED = 405, /* "HTTP/1.0 405 Method Not Allowed" */
419  SL_NETAPP_HTTP_RESPONSE_500_INTERNAL_SERVER_ERROR = 500,/* 500 Internal Server Error */
420  SL_NETAPP_HTTP_RESPONSE_503_SERVICE_UNAVAILABLE = 503, /* "HTTP/1.0 503 Service Unavailable" */
421  SL_NETAPP_HTTP_RESPONSE_504_GATEWAY_TIMEOUT = 504 /* "HTTP/1.0 504 Gateway Timeout" */
422 } SlNetAppResponseCode_e;
423 
424 
425 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION 0x00000001
426 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA 0x00000002 /* 0 - data is payload, 1 - data is metadata */
427 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_ACCUMULATION 0x00000004
428 #define SL_NETAPP_REQUEST_RESPONSE_FLAGS_ERROR 0x80000000 /* in that case the last two bytes represents the error code */
429 
430 typedef struct
431 {
432  _u16 MetadataLen;
433  _u8 *pMetadata;
434  _u16 PayloadLen;
435  _u8 *pPayload;
436  _u32 Flags;
438 
439 typedef struct
440 {
441  _u8 AppId;
442  _u8 Type;
443  _u16 Handle;
444  SlNetAppData_t requestData;
445 
447 
448 typedef struct
449 {
450  _u16 Status;
451  SlNetAppData_t ResponseData;
452 
454 
455 
456 typedef struct
457 {
458  _u32 lease_time;
459  _u32 ipv4_addr_start;
460  _u32 ipv4_addr_last;
462 
463 /* mDNS parameters */
464 typedef enum
465 {
466  SL_NETAPP_FULL_SERVICE_WITH_TEXT_IPV4_TYPE = 1,
467  SL_NETAPP_FULL_SERVICE_IPV4_TYPE,
468  SL_NETAPP_SHORT_SERVICE_IPV4_TYPE,
469  SL_NETAPP_FULL_SERVICE_WITH_TEXT_IPV6_TYPE ,
470  SL_NETAPP_FULL_SERVICE_IPV6_TYPE,
471  SL_NETAPP_SHORT_SERVICE_IPV6_TYPE
472 } SlNetAppGetServiceListType_e;
473 
474 typedef struct
475 {
476  _u32 service_ipv4;
477  _u16 service_port;
478  _u16 Reserved;
480 
481 typedef struct
482 {
483  _u32 service_ipv4;
484  _u16 service_port;
485  _u16 Reserved;
486  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
487  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
489 
490 typedef struct
491 {
492  _u32 service_ipv4;
493  _u16 service_port;
494  _u16 Reserved;
495  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
496  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
497  _u8 service_text[SL_NETAPP_MAX_SERVICE_TEXT_SIZE];
499 
500 /* IPv6 entries */
501 typedef struct
502 {
503  _u32 service_ipv6[4];
504  _u16 service_port;
505  _u16 Reserved;
507 
508 typedef struct
509 {
510  _u32 service_ipv6[4];
511  _u16 service_port;
512  _u16 Reserved;
513  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
514  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
516 
517 typedef struct
518 {
519  _u32 service_ipv6[4];
520  _u16 service_port;
521  _u16 Reserved;
522  _u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE];
523  _u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
524  _u8 service_text[SL_NETAPP_MAX_SERVICE_TEXT_SIZE];
526 
527 
528 typedef struct
529 {
530  /*The below parameters are used to configure the advertise times and interval
531  For example:
532  If:
533  Period is set to T
534  Repetitions are set to P
535  Telescopic factor is K=2
536  The transmission shall be:
537  advertise P times
538  wait T
539  advertise P times
540  wait 4 * T
541  advertise P time
542  wait 16 * T ... (till max time reached / configuration changed / query issued)
543  */
544  _u32 t; /* Number of ticks for the initial period. Default is 100 ticks for 1 second. */
545  _u32 p; /* Number of repetitions. Default value is 1 */
546  _u32 k; /* Telescopic factor. Default value is 2. */
547  _u32 RetransInterval;/* Announcing retransmission interval */
548  _u32 Maxinterval; /* Announcing max period interval */
549  _u32 max_time; /* Announcing max time */
551 
552 
553 typedef struct
554 {
555  _u16 MaxResponseTime;
556  _u16 NumOfRetries;
558 
559 /*****************************************************************************/
560 /* Types declarations */
561 /*****************************************************************************/
562 typedef void (*P_SL_DEV_PING_CALLBACK)(SlNetAppPingReport_t*);
563 
564 /*****************************************************************************/
565 /* Function prototypes */
566 /*****************************************************************************/
567 
568 
593 #if _SL_INCLUDE_FUNC(sl_NetAppStart)
594 _i16 sl_NetAppStart(const _u32 AppBitMap);
595 #endif
596 
622 #if _SL_INCLUDE_FUNC(sl_NetAppStop)
623 _i16 sl_NetAppStop(const _u32 AppBitMap);
624 #endif
625 
676 #if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByName)
677 _i16 sl_NetAppDnsGetHostByName(_i8 * pHostName,const _u16 NameLen, _u32* OutIpAddr,const _u8 Family );
678 #endif
679 
733 #if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByService)
734 _i16 sl_NetAppDnsGetHostByService(_i8 *pServiceName, /* string containing all (or only part): name + subtype + service */
735  const _u8 ServiceLen,
736  const _u8 Family, /* 4-IPv4 , 16-IPv6 */
737  _u32 pAddr[],
738  _u32 *pPort,
739  _u16 *pTextLen, /* in: max len , out: actual len */
740  _i8 *pText
741  );
742 
743 #endif
744 
795 #if _SL_INCLUDE_FUNC(sl_NetAppGetServiceList)
796 _i16 sl_NetAppGetServiceList(const _u8 IndexOffset,
797  const _u8 MaxServiceCount,
798  const _u8 Flags,
799  _i8 *pBuffer,
800  const _u32 BufferLength
801  );
802 
803 #endif
804 
834 #if _SL_INCLUDE_FUNC(sl_NetAppMDNSUnRegisterService)
835 _i16 sl_NetAppMDNSUnRegisterService(const _i8 *pServiceName,const _u8 ServiceNameLen,_u32 Options);
836 #endif
837 
902 #if _SL_INCLUDE_FUNC(sl_NetAppMDNSRegisterService)
903 _i16 sl_NetAppMDNSRegisterService( const _i8* pServiceName,
904  const _u8 ServiceNameLen,
905  const _i8* pText,
906  const _u8 TextLen,
907  const _u16 Port,
908  const _u32 TTL,
909  _u32 Options);
910 #endif
911 
976 #if _SL_INCLUDE_FUNC(sl_NetAppPing)
977 _i16 sl_NetAppPing(const SlNetAppPingCommand_t* pPingParams,const _u8 Family, SlNetAppPingReport_t *pReport, const P_SL_DEV_PING_CALLBACK pPingCallback);
978 #endif
979 
1181 #if _SL_INCLUDE_FUNC(sl_NetAppSet)
1182 _i16 sl_NetAppSet(const _u8 AppId ,const _u8 Option,const _u8 OptionLen,const _u8 *pOptionValue);
1183 #endif
1184 
1281 #if _SL_INCLUDE_FUNC(sl_NetAppGet)
1282 _i16 sl_NetAppGet(const _u8 AppId, const _u8 Option,_u8 *pOptionLen, _u8 *pOptionValue);
1283 #endif
1284 
1303 #if _SL_INCLUDE_FUNC(sl_NetAppSend)
1304 _u16 sl_NetAppSend( _u16 Handle, _u16 DataLen, _u8 *pData, _u32 Flags);
1305 #endif
1306 
1323 #if _SL_INCLUDE_FUNC(sl_NetAppRecv)
1324 _SlReturnVal_t sl_NetAppRecv( _u16 Handle, _u16 *DataLen, _u8 *pData, _u32 *Flags);
1325 #endif
1326 
1327 
1336 #ifdef __cplusplus
1337 }
1338 #endif /* __cplusplus */
1339 
1340 #endif /* __NETAPP_H__ */
1341 
Definition: netapp.h:326
_i16 sl_NetAppSet(const _u8 AppId, const _u8 Option, const _u8 OptionLen, const _u8 *pOptionValue)
Setting network application configurations.
Definition: netapp.c:1135
_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:494
_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:1283
_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:614
_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:856
_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:1002
_i16 sl_NetAppStart(const _u32 AppBitMap)
Starts a network application.
Definition: netapp.c:108
_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:440
_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:179
_i16 sl_NetAppStop(const _u32 AppBitMap)
Stops a network application.
Definition: netapp.c:137
_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:1416
_i16 sl_NetAppGet(const _u8 AppId, const _u8 Option, _u8 *pOptionLen, _u8 *pOptionValue)
Getting network applications configurations.
Definition: netapp.c:1462