SimpleLink CC31xx/CC32xx Host Driver  Version 3.0.1.46
Simplifies the implementation of Internet connectivity
NetApp

Activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS. More...

Functions

_i16 sl_NetAppStart (const _u32 AppBitMap)
 Starts a network application. More...
 
_i16 sl_NetAppStop (const _u32 AppBitMap)
 Stops a network application. More...
 
_i16 sl_NetAppArpFlush ()
 Flush IPv4 ARP table. More...
 
_i16 sl_NetAppNdFlush ()
 Flush IPv6 Neighbor Discovery table. More...
 
_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. More...
 
_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 service name Full/Part (see example below), and should get: More...
 
_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's services that are in the NWP without issuing any queries (relying on previous collected data).
The list is in a form of service struct. The user should chose the type of the service struct like: More...
 
_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. More...
 
_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 DB.
This registered service is a service offered by the application. The service name should be full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer.
Example for service name: More...
 
_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 More...
 
_i16 sl_NetAppSet (const _u8 AppId, const _u8 Option, const _u8 OptionLen, const _u8 *pOptionValue)
 Setting network application configurations. More...
 
_i16 sl_NetAppGet (const _u8 AppId, const _u8 Option, _u8 *pOptionLen, _u8 *pOptionValue)
 Getting network applications configurations. More...
 
_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) More...
 
_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.e. HTTP POST request) More...
 

Typedefs

typedef void(* P_SL_DEV_PING_CALLBACK) (SlNetAppPingReport_t *)
 

Enumerations

enum  SlNetAppEventId_e {
  SL_NETAPP_EVENT_IPV4_ACQUIRED = 1,
  SL_NETAPP_EVENT_IPV6_ACQUIRED,
  SL_NETAPP_EVENT_IP_COLLISION,
  SL_NETAPP_EVENT_DHCPV4_LEASED,
  SL_NETAPP_EVENT_DHCPV4_RELEASED,
  SL_NETAPP_EVENT_HTTP_TOKEN_GET,
  SL_NETAPP_EVENT_HTTP_TOKEN_POST,
  SL_NETAPP_EVENT_IPV4_LOST,
  SL_NETAPP_EVENT_DHCP_IPV4_ACQUIRE_TIMEOUT,
  SL_NETAPP_EVENT_IPV6_LOST,
  SL_NETAPP_EVENT_NO_IPV4_COLLISION_DETECTED,
  SL_NETAPP_EVENT_NO_LOCAL_IPV6_COLLISION_DETECTED,
  SL_NETAPP_EVENT_NO_GLOBAL_IPV6_COLLISION_DETECTED,
  SL_NETAPP_EVENT_MAX
}
 
enum  SlIpV6AcquiredAsyncType_e {
  SL_BSD_IPV6_ACQUIRED_TYPE_LOCAL = 1,
  SL_BSD_IPV6_ACQUIRED_TYPE_GLOBAL = 2
}
 
enum  SlNetAppMetadataHTTPTypes_e {
  SL_NETAPP_REQUEST_METADATA_TYPE_STATUS = 0,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_VERSION,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REQUEST_URI,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_QUERY_STRING,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_LEN,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_TYPE,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_LOCATION,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_SERVER,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_USER_AGENT,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_COOKIE,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_SET_COOKIE,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_UPGRADE,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REFERER,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_ACCEPT,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_ENCODING,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONTENT_DISPOSITION,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_CONNECTION,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_ETAG,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_DATE,
  SL_NETAPP_REQUEST_METADATA_TYPE_HEADER_HOST,
  SL_NETAPP_REQUEST_METADATA_TYPE_ACCEPT_ENCODING,
  SL_NETAPP_REQUEST_METADATA_TYPE_ACCEPT_LANGUAGE,
  SL_NETAPP_REQUEST_METADATA_TYPE_CONTENT_LANGUAGE,
  SL_NETAPP_REQUEST_METADATA_TYPE_ORIGIN,
  SL_NETAPP_REQUEST_METADATA_TYPE_ORIGIN_CONTROL_ACCESS,
  SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_NONE
}
 
enum  SlNetAppResponseCode_e {
  SL_NETAPP_RESPONSE_NONE = 0,
  SL_NETAPP_RESPONSE_PENDING = 1,
  SL_NETAPP_HTTP_RESPONSE_101_SWITCHING_PROTOCOLS = 101,
  SL_NETAPP_HTTP_RESPONSE_200_OK = 200,
  SL_NETAPP_HTTP_RESPONSE_201_CREATED = 201,
  SL_NETAPP_HTTP_RESPONSE_202_ACCEPTED = 202,
  SL_NETAPP_HTTP_RESPONSE_204_OK_NO_CONTENT = 204,
  SL_NETAPP_HTTP_RESPONSE_301_MOVED_PERMANENTLY = 301,
  SL_NETAPP_HTTP_RESPONSE_302_MOVED_TEMPORARILY = 302,
  SL_NETAPP_HTTP_RESPONSE_303_SEE_OTHER = 303,
  SL_NETAPP_HTTP_RESPONSE_304_NOT_MODIFIED = 304,
  SL_NETAPP_HTTP_RESPONSE_400_BAD_REQUEST = 400,
  SL_NETAPP_HTTP_RESPONSE_403_FORBIDDEN = 403,
  SL_NETAPP_HTTP_RESPONSE_404_NOT_FOUND = 404,
  SL_NETAPP_HTTP_RESPONSE_405_METHOD_NOT_ALLOWED = 405,
  SL_NETAPP_HTTP_RESPONSE_500_INTERNAL_SERVER_ERROR = 500,
  SL_NETAPP_HTTP_RESPONSE_503_SERVICE_UNAVAILABLE = 503,
  SL_NETAPP_HTTP_RESPONSE_504_GATEWAY_TIMEOUT = 504
}
 
enum  SlNetAppGetServiceListType_e {
  SL_NETAPP_FULL_SERVICE_WITH_TEXT_IPV4_TYPE = 1,
  SL_NETAPP_FULL_SERVICE_IPV4_TYPE,
  SL_NETAPP_SHORT_SERVICE_IPV4_TYPE,
  SL_NETAPP_FULL_SERVICE_WITH_TEXT_IPV6_TYPE,
  SL_NETAPP_FULL_SERVICE_IPV6_TYPE,
  SL_NETAPP_SHORT_SERVICE_IPV6_TYPE
}
 

Detailed Description

Activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS.

Function Documentation

§ sl_NetAppArpFlush()

_i16 sl_NetAppArpFlush ( )

Flush IPv4 ARP table.

Parameters
[in]None
Returns
Zero on success, or negative error code on failure
See also
sl_NetAppArpFlush
Note
This command flush IPv4 ARP table
Warning
Example

Definition at line 151 of file netapp.c.

152 {
153  /* verify that this api is allowed. if not allowed then
154  ignore the API execution and return immediately with an error */
155  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
156 
157  return _SlDrvBasicCmd(SL_OPCODE_NETAPP_ARPFLUSH);
158 }

§ sl_NetAppDnsGetHostByName()

_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.

Parameters
[in]pHostNameHost name
[in]NameLenName length
[out]OutIpAddrThis parameter is filled in with host IP address. In case that host name is not resolved, out_ip_addr is zero.
[in]FamilyProtocol family
Returns
Zero on success, or negative on failure.
SL_POOL_IS_EMPTY may be return in case there are no resources in the system
In this case try again later or increase MAX_CONCURRENT_ACTIONS Possible DNS error codes:
  • SL_NETAPP_DNS_QUERY_NO_RESPONSE
  • SL_NETAPP_DNS_NO_SERVER
  • SL_NETAPP_DNS_QUERY_FAILED
  • SL_NETAPP_DNS_MALFORMED_PACKET
  • SL_NETAPP_DNS_MISMATCHED_RESPONSE
See also
Note
Only one sl_NetAppDnsGetHostByName can be handled at a time.
Calling this API while the same command is called from another thread, may result in one of the two scenarios:
  1. The command will wait (internal) until the previous command finish, and then be executed.
  2. There are not enough resources and POOL_IS_EMPTY error will return.
    In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
Warning
In case an IP address in a string format is set as input, without any prefix (e.g. "1.2.3.4") the device will not try to access the DNS and it will return the input address on the 'out_ip_addr' field
Example

Definition at line 841 of file netapp.c.

842 {
843  _SlGetHostByNameMsg_u Msg;
844  _SlCmdExt_t ExtCtrl;
845  _GetHostByNameAsyncResponse_u AsyncRsp;
846  _i16 ObjIdx = MAX_CONCURRENT_ACTIONS;
847 
848  /* verify that this api is allowed. if not allowed then
849  ignore the API execution and return immediately with an error */
850  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
851 
852  _SlDrvResetCmdExt(&ExtCtrl);
853  ExtCtrl.TxPayload1Len = NameLen;
854  ExtCtrl.pTxPayload1 = (_u8 *)pHostName;
855 
856  Msg.Cmd.Len = NameLen;
857  Msg.Cmd.Family = Family;
858 
859  /*Use Obj to issue the command, if not available try later */
860  ObjIdx = _SlDrvWaitForPoolObj(GETHOSYBYNAME_ID,SL_MAX_SOCKETS);
861  if (MAX_CONCURRENT_ACTIONS == ObjIdx)
862  {
863  return SL_POOL_IS_EMPTY;
864  }
865  if (SL_RET_CODE_STOP_IN_PROGRESS == ObjIdx)
866  {
867  return SL_RET_CODE_STOP_IN_PROGRESS;
868  }
869 
870  SL_DRV_PROTECTION_OBJ_LOCK_FOREVER();
871 
872  g_pCB->ObjPool[ObjIdx].pRespArgs = (_u8 *)&AsyncRsp;
873  /*set bit to indicate IPv6 address is expected */
874  if (SL_AF_INET6 == Family)
875  {
876  g_pCB->ObjPool[ObjIdx].AdditionalData |= SL_NETAPP_FAMILY_MASK;
877  }
878 
879  SL_DRV_PROTECTION_OBJ_UNLOCK();
880 
881  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlGetHostByNameCtrl, &Msg, &ExtCtrl));
882 
883  if(SL_RET_CODE_OK == Msg.Rsp.status)
884  {
885  VERIFY_RET_OK(_SlDrvWaitForInternalAsyncEvent(ObjIdx,0,0));
886 
887  Msg.Rsp.status = (_i16)AsyncRsp.IpV4.Status;
888 
889  if(SL_OS_RET_CODE_OK == (_i16)Msg.Rsp.status)
890  {
891  sl_Memcpy((_i8 *)OutIpAddr,
892  (_i8 *)&AsyncRsp.IpV4.Ip0,
893  (SL_AF_INET == Family) ? SL_IPV4_ADDRESS_SIZE : SL_IPV6_ADDRESS_SIZE);
894  }
895  }
896  _SlDrvReleasePoolObj(ObjIdx);
897  return Msg.Rsp.status;
898 }

§ sl_NetAppDnsGetHostByService()

_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 service name Full/Part (see example below), and should get:

  • IP of service
  • The port of service
  • The text of service Hence it can make a connection to the specific service and use it. It is similar to sl_NetAppDnsGetHostByName method.
    It is done by a single shot ipv4 & ipv6 (if enabled) query with PTR type on the service name. The command that is sent is from constant parameters and variables parameters.
Parameters
[in]pServiceNameService name can be full or partial.
Example for full service name:
  1. PC1._ipp._tcp.local
  2. PC2_server._ftp._tcp.local
Example for partial service name:
  1. _ipp._tcp.local
  2. _ftp._tcp.local
[in]ServiceLenThe length of the service name (in_pService).
[in]FamilyIPv4 or IPv6 (SL_AF_INET , SL_AF_INET6).
[out]pAddrContains the IP address of the service.
[out]pPortContains the port of the service.
[out]pTextLenHas 2 options. One as Input field and the other one as output:
  • Input:
    Contains the max length of the text that the user wants to get.
    It means that if the text len of service is bigger that its value than the text is cut to inout_TextLen value.
  • Output:
    Contain the length of the text that is returned. Can be full text or part of the text (see above).
[out]pTextContains the text of the service full or partial
Returns
Zero on success,
SL_POOL_IS_EMPTY may be return in case there are no resources in the system, In this case try again later or increase MAX_CONCURRENT_ACTIONS
In case No service is found error SL_NETAPP_DNS_NO_ANSWER will be returned
See also
sl_NetAppDnsGetHostByName
Note
The returns attributes belongs to the first service found. There may be other services with the same service name that will response to the query. The results of these responses are saved in the peer cache of the Device and should be read by another API.
Only one sl_NetAppDnsGetHostByService can be handled at a time.
Calling this API while the same command is called from another thread, may result in one of the two scenarios:
  1. The command will wait (internal) until the previous command finish, and then be executed.
  2. There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
Warning
Text length can be 120 bytes only

Definition at line 613 of file netapp.c.

621 {
622  _SlGetHostByServiceMsg_u Msg;
623  _SlCmdExt_t CmdExt ;
624  _GetHostByServiceAsyncResponse_t AsyncRsp;
625  _i16 ObjIdx = MAX_CONCURRENT_ACTIONS;
626 
627  /* verify that this api is allowed. if not allowed then
628  ignore the API execution and return immediately with an error */
629  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
630  _SlDrvMemZero(&AsyncRsp, sizeof(_GetHostByServiceAsyncResponse_t));
631 
632 /*
633  Note:
634  1. The return's attributes are belonged to first service that is found.
635  It can be other services with the same service name will response to
636  the query. The results of these responses are saved in the peer cache of the NWP, and
637  should be read by another API.
638 
639  2. Text length can be 120 bytes only - not more
640  It is because of constraints in the NWP on the buffer that is allocated for the Async event.
641 
642  3.The API waits to Async event by blocking. It means that the API is finished only after an Async event
643  is sent by the NWP.
644 
645  4.No rolling option!!! - only PTR type is sent.
646 
647 */
648  /*build the attribute part of the command.
649  It contains the constant parameters of the command */
650 
651  Msg.Cmd.ServiceLen = ServiceLen;
652  Msg.Cmd.AddrLen = Family;
653 
654  /*Build the payload part of the command
655  Copy the service name and text to one buffer.*/
656 
657  _SlDrvResetCmdExt(&CmdExt);
658  CmdExt.TxPayload1Len = ServiceLen;
659  CmdExt.pTxPayload1 = (_u8 *)pServiceName;
660 
661  /*set pointers to the output parameters (the returned parameters).
662  This pointers are belonged to local struct that is set to global Async response parameter.
663  It is done in order not to run more than one sl_DnsGetHostByService at the same time.
664  The API should be run only if global parameter is pointed to NULL. */
665  AsyncRsp.out_pText = pText;
666  AsyncRsp.inout_TextLen = (_u16* )pTextLen;
667  AsyncRsp.out_pPort = pPort;
668  AsyncRsp.out_pAddr = (_u32 *)&pAddr[0];
669 
670  ObjIdx = _SlDrvProtectAsyncRespSetting((_u8*)&AsyncRsp, GETHOSYBYSERVICE_ID, SL_MAX_SOCKETS);
671 
672  if (MAX_CONCURRENT_ACTIONS == ObjIdx)
673  {
674  return SL_POOL_IS_EMPTY;
675  }
676 
677  if (SL_AF_INET6 == Family)
678  {
679  g_pCB->ObjPool[ObjIdx].AdditionalData |= SL_NETAPP_FAMILY_MASK;
680  }
681  /* Send the command */
682  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlGetHostByServiceCtrl, &Msg, &CmdExt));
683 
684  /* If the immediate reponse is O.K. than wait for aSYNC event response. */
685  if(SL_RET_CODE_OK == Msg.Rsp.status)
686  {
687  VERIFY_RET_OK(_SlDrvWaitForInternalAsyncEvent(ObjIdx,0,0));
688 
689  /* If we are - it means that Async event was sent.
690  The results are copied in the Async handle return functions */
691 
692  Msg.Rsp.status = AsyncRsp.Status;
693  }
694 
695  _SlDrvReleasePoolObj(ObjIdx);
696  return Msg.Rsp.status;
697 }

§ sl_NetAppGet()

_i16 sl_NetAppGet ( const _u8  AppId,
const _u8  Option,
_u8 *  pOptionLen,
_u8 *  pOptionValue 
)

Getting network applications configurations.

Parameters
[in]AppIdApplication id, could be one of the following:
  • SL_NETAPP_HTTP_SERVER_ID
  • SL_NETAPP_DHCP_SERVER_ID
  • SL_NETAPP_DNS_SERVER_ID
  • SL_NETAPP_DEVICE_ID
  • SL_NETAPP_DNS_CLIENT_ID
[in]OptionGet option, could be one of the following:
  • SL_NETAPP_DHCP_SERVER_ID:
  • SL_NETAPP_DHCP_SRV_BASIC_OPT
  • SL_NETAPP_HTTP_SERVER_ID:
  • SL_NETAPP_HTTP_PRIMARY_PORT_NUMBER
  • SL_NETAPP_HTTP_AUTH_CHECK
  • SL_NETAPP_HTTP_AUTH_NAME
  • SL_NETAPP_HTTP_AUTH_PASSWORD
  • SL_NETAPP_HTTP_AUTH_REALM
  • SL_NETAPP_HTTP_ROM_PAGES_ACCESS
  • SL_NETAPP_HTTP_SECONDARY_PORT_NUMBER
  • SL_NETAPP_HTTP_SECONDARY_PORT_ENABLE
  • SL_NETAPP_HTTP_PRIMARY_PORT_SECURITY_MODE
  • SL_NETAPP_MDNS_ID:
  • SL_NETAPP_MDNS_CONT_QUERY_OPT
  • SL_NETAPP_MDNS_QEVETN_MASK_OPT
  • SL_NETAPP_MDNS_TIMING_PARAMS_OPT
  • SL_NETAPP_DEVICE_ID:
  • SL_NETAPP_DEVICE_URN
  • SL_NETAPP_DEVICE_DOMAIN
  • SL_NETAPP_DNS_CLIENT_ID:
  • SL_NETAPP_DNS_CLIENT_TIME
[in]pOptionLenThe length of the allocated memory as input, when the function complete, the value of this parameter would be the len that actually read from the device.
If the device return length that is longer from the input value, the function will cut the end of the returned structure and will return ESMALLBUF
[out]pOptionValuepointer to the option structure which will be filled with the response from the device
Returns
Zero on success, or negative value if an error occurred.
See also
sl_NetAppSet
Note
Warning
Example
  • Getting DHCP Server parameters example:
    _u8 outLen = sizeof(SlNetAppDhcpServerBasicOpt_t);
    sl_NetAppGet(SL_NETAPP_DHCP_SERVER_ID, SL_NETAPP_SET_DHCP_SRV_BASIC_OPT, &outLen, (_u8* )&dhcpParams);
    printf("DHCP Start IP %d.%d.%d.%d End IP %d.%d.%d.%d Lease time seconds %d\n",
    SL_IPV4_BYTE(dhcpParams.ipv4_addr_start,3),SL_IPV4_BYTE(dhcpParams.ipv4_addr_start,2),
    SL_IPV4_BYTE(dhcpParams.ipv4_addr_start,1),SL_IPV4_BYTE(dhcpParams.ipv4_addr_start,0),
    SL_IPV4_BYTE(dhcpParams.ipv4_addr_last,3),SL_IPV4_BYTE(dhcpParams.ipv4_addr_last,2),
    SL_IPV4_BYTE(dhcpParams.ipv4_addr_last,1),SL_IPV4_BYTE(dhcpParams.ipv4_addr_last,0),
    dhcpParams.lease_time);

  • Getting device URN name:
    Maximum length of 32 characters of device name. Device name affects URN name, own SSID name in AP mode, and WPS file "device name" in WPS I.E (STA-WPS / P2P) in case no device URN name set, the default name is "mysimplelink"
    _u8 my_device_name[SL_NETAPP_MAX_DEVICE_URN_LEN];
    sl_NetAppGet (SL_NETAPP_DEVICE_ID, SL_NETAPP_DEVICE_URN, strlen(my_device_name), (_u8 *)my_device_name);

  • Getting DNS client time:
    Get DNS client (sl_NetAppDnsGetHostByName) timeout, two parameters max_response_time and number_retries. number_retries: Max number of DNS request before sl_NetAppDnsGetHostByName failed. max_response_time: DNS request timeout changed every retry, it`s start with 100 millisecond and increased every retry up to max_response_time milliseconds
    _u8 pOptionLen = sizeof(time);
    sl_NetAppGet (SL_NETAPP_DNS_CLIENT_ID, SL_NETAPP_DNS_CLIENT_TIME, &pOptionLen, (_u8 *)&time);

  • get DNS caching mode:
    By deafult the DNS caching is enabled, 0 - disable, 1 - enabled.
    _u8 enabled;
    _u8 pOptionLen = sizeof(enabled)
    sl_NetAppGet (SL_NETAPP_DNS_CLIENT_ID, SL_NETAPP_DNS_CLIENT_CACHE_ENABLE, &pOptionLen,&enabled);

  • Getting active applications:
    Get active applications for active role. return value is mask of the active application (similar defines as sl_NetAppStart):
    _u32 AppBitMap;
    _u8 pOptionLen = sizeof(AppBitMap);
    sl_NetAppGet (SL_NETAPP_STATUS, SL_NETAPP_STATUS_ACTIVE_APP, &pOptionLen, (_u8 *)&AppBitMap);

Definition at line 1429 of file netapp.c.

1430 {
1431  _SlNetAppMsgGet_u Msg;
1432  _SlCmdExt_t CmdExt;
1433 
1434  /* verify that this api is allowed. if not allowed then
1435  ignore the API execution and return immediately with an error */
1436  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
1437 
1438  if (*pOptionLen == 0)
1439  {
1440  return SL_EZEROLEN;
1441  }
1442 
1443  _SlDrvResetCmdExt(&CmdExt);
1444  CmdExt.RxPayloadLen = (_i16)(*pOptionLen);
1445  CmdExt.pRxPayload = (_u8 *)pOptionValue;
1446 
1447  Msg.Cmd.AppId = AppId;
1448  Msg.Cmd.ConfigOpt = Option;
1449  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppGetCmdCtrl, &Msg, &CmdExt));
1450 
1451 
1452  if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
1453  {
1454  *pOptionLen = (_u8)CmdExt.RxPayloadLen;
1455  return SL_ESMALLBUF;
1456  }
1457  else
1458  {
1459  *pOptionLen = (_u8)CmdExt.ActualRxPayloadLen;
1460  }
1461 
1462  return (_i16)Msg.Rsp.Status;
1463 }

§ sl_NetAppGetServiceList()

_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's services that are in the NWP without issuing any queries (relying on previous collected data).
The list is in a form of service struct. The user should chose the type of the service struct like:

  • Full service parameters with text.
  • Full service parameters.
  • Short service parameters (port and IP only) especially for tiny hosts.

The different types of struct are made to give the possibility to save memory in the host.
The user can also chose how many max services to get and start point index NWP peer cache.
For example:

  1. Get max of 3 full services from index 0.
    • Up to 3 full services from index 0 are inserted into pBuffer (services that are in indexes 0,1,2).
  2. Get max of 4 full services from index 3.
    • Up to 4 full services from index 3 are inserted into pBuffer (services that are in indexes 3,4,5,6).
  3. Get max of 2 int services from index 6.
    • Up to 2 int services from index 6 are inserted into pBuffer (services that are in indexes 6,7). See below - command parameters.
Parameters
[in]IndexOffset- The start index in the peer cache that from it the first service is returned.
[in]MaxServiceCount- The Max services that can be returned if existed or if not exceed the max index in the peer cache
[in]Flags- an ENUM number that means which service struct to use (means which types of service to fill)
[out]pBuffer- The Services are inserted into this buffer. In the struct form according to the bit that is set in the Flags input parameter.
[in]BufferLength- The allocated buffer length (pointed by pBuffer).
Returns
ServiceFoundCount - The number of the services that were inserted into the buffer.
Zero means no service is found negative number means an error
See also
sl_NetAppMDNSRegisterService
Note
Warning
If the out pBuffer size is bigger than an RX packet(1480), than an error is returned because there is no place in the RX packet.
The size is a multiply of MaxServiceCount and size of service struct(that is set according to flag value).

Definition at line 205 of file netapp.c.

211 {
212 
213  _i32 retVal= 0;
214  _SlNetappGetServiceListMsg_u Msg;
215  _SlCmdExt_t CmdExt;
216  _u16 ServiceSize = 0;
217  _u16 BufferSize = 0;
218 
219  /* verify that this api is allowed. if not allowed then
220  ignore the API execution and return immediately with an error */
221  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
222 
223  /*
224  Calculate RX pBuffer size
225  WARNING:
226  if this size is BufferSize than 1480 error should be returned because there
227  is no place in the RX packet.
228  */
229  ServiceSize = NetAppServiceSizeLUT[Flags & SL_NETAPP_SERVICE_SIZE_MASK];
230  BufferSize = MaxServiceCount * ServiceSize;
231 
232  /* Check the size of the requested services is smaller than size of the user buffer.
233  If not an error is returned in order to avoid overwriting memory. */
234  if(BufferLength < BufferSize)
235  {
236  return SL_ERROR_NET_APP_RX_BUFFER_LENGTH;
237  }
238 
239  _SlDrvResetCmdExt(&CmdExt);
240  CmdExt.RxPayloadLen = (_i16)BufferSize;
241  CmdExt.pRxPayload = (_u8 *)pBuffer;
242 
243  Msg.Cmd.IndexOffest = IndexOffest;
244  Msg.Cmd.MaxServiceCount = MaxServiceCount;
245  Msg.Cmd.Flags = Flags;
246  Msg.Cmd.Padding = 0;
247 
248  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlGetServiceListeCtrl, &Msg, &CmdExt));
249  retVal = Msg.Rsp.status;
250 
251  return (_i16)retVal;
252 }

§ sl_NetAppMDNSRegisterService()

_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 DB.
This registered service is a service offered by the application. The service name should be full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer.
Example for service name:

  1. PC1._ipp._tcp.local
  2. PC2_server._ftp._tcp.local

If the option is_unique is set, mDNS probes the service name to make sure it is unique before starting to announce the service on the network. Instance is the instance portion of the service name.

Parameters
[in]ServiceNameLenThe length of the service.
[in]TextLenThe length of the service should be smaller than 64.
[in]PortThe port on this target host port.
[in]TTLThe TTL of the service
[in]Optionsbitwise parameters:
  • SL_NETAPP_MDNS_OPTIONS_IS_UNIQUE_BIT bit 0 - service is unique per interface (means that the service needs to be unique)
  • SL_NETAPP_MDNS_IPV6_IPV4_SERVICE bit 27 - add this service to IPv6 interface, if exist (default is IPv4 service only)
  • SL_NETAPP_MDNS_IPV6_ONLY_SERVICE bit 28 - add this service to IPv6 interface, but remove it from IPv4 (only IPv6 is available)
  • SL_NETAPP_MDNS_OPTION_UPDATE_TEXT bit 29 - for update text fields (without reregister the service)
  • SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT bit 30 - for setting a non persistent service
  • SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT bit 31 - for internal use if the service should be added or deleted (set means ADD).
[in]pServiceNameThe service name.
[in]pTextThe description of the service. should be as mentioned in the RFC (according to type of the service IPP,FTP...)
Returns
Zero on success, or negative error code on failure
Persistent - Optionally persistent
See also
sl_NetAppMDNSUnRegisterService
Warning
1) Temporary - there is an allocation on stack of internal buffer. Its size is SL_NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
It means that the sum of the text length and service name length cannot be bigger than SL_NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
If it is - An error is returned.
2) According to now from certain constraints the variables parameters are set in the attribute part (contain constant parameters)
Examples:
  • Register a new service:
    const signed char AddService[40] = "PC1._ipp._tcp.local";
    _u32 Options;
    Options = SL_NETAPP_MDNS_OPTIONS_IS_UNIQUE_BIT | SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT;
    sl_NetAppMDNSRegisterService(AddService,sizeof(AddService),"Service 1;payper=A3;size=5",strlen("Service 1;payper=A3;size=5"),1000,120,Options);

  • Update text for existing service:
    Please Note! Update is for text only! Important to apply the same persistent flag options as original service registration.\n
    Options = SL_NETAPP_MDNS_OPTION_UPDATE_TEXT | SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT;
    sl_NetAppMDNSRegisterService(AddService,sizeof(AddService),"Service 5;payper=A4;size=10",strlen("Service 5;payper=A4;size=10"),1000,120,Options);

Definition at line 453 of file netapp.c.

460 {
461  /* verify that this api is allowed. if not allowed then
462  ignore the API execution and return immediately with an error */
463  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
464 
465  /*
466 
467  NOTE - pay attention
468 
469  1. Temporary - there is an allocation on stack of internal buffer.
470  Its size is SL_NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
471  It means that the sum of the text length and service name length cannot be bigger than
472  SL_NETAPP_MDNS_MAX_SERVICE_NAME_AND_TEXT_LENGTH.
473  If it is - An error is returned.
474 
475  2. According to now from certain constraints the variables parameters are set in the
476  attribute part (contain constant parameters)
477 
478  */
479 
480  /*Set the add service bit in the options parameter.
481  In order not use different opcodes for the register service and unregister service
482  bit 31 in option is taken for this purpose. if it is set it means in NWP that the service should be added
483  if it is cleared it means that the service should be deleted and there is only meaning to pServiceName
484  and ServiceNameLen values. */
485  Options |= SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT;
486 
487  return _SlNetAppMDNSRegisterUnregisterService(pServiceName,
488  ServiceNameLen,
489  pText,
490  TextLen,
491  Port,
492  TTL,
493  Options);
494 }

§ sl_NetAppMDNSUnRegisterService()

_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.

The mDNS service that is to be unregistered is a service that the application no longer wishes to provide.
The service name should be the full service name according to RFC of the DNS-SD - meaning the value in name field in the SRV answer.

Examples for service names:

  1. PC1._ipp._tcp.local
  2. PC2_server._ftp._tcp.local
Parameters
[in]pServiceNameFull service name.
[in]ServiceNameLenThe length of the service.
[in]Optionsbitwise parameters:
  • SL_NETAPP_MDNS_OPTIONS_IS_UNIQUE_BIT bit 0 - service is unique per interface (means that the service needs to be unique)
  • SL_NETAPP_MDNS_IPV6_IPV4_SERVICE bit 27 - add this service to IPv6 interface, if exist (default is IPv4 service only)
  • SL_NETAPP_MDNS_IPV6_ONLY_SERVICE bit 28 - add this service to IPv6 interface, but remove it from IPv4 (only IPv6 is available)
  • SL_NETAPP_MDNS_OPTION_UPDATE_TEXT bit 29 - for update text fields (without reregister the service)
  • SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT bit 30 - for setting a non persistent service
  • SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT bit 31 - for internal use if the service should be added or deleted (set means ADD).
Returns
Zero on success, or negative error code on failure
Persistent - Optionally persistent
See also
sl_NetAppMDNSRegisterService
Note
Warning
The size of the service length should be smaller than 255.

Definition at line 502 of file netapp.c.

504 {
505 
506  /* verify that this api is allowed. if not allowed then
507  ignore the API execution and return immediately with an error */
508  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
509 
510  /*
511 
512  NOTE - pay attention
513 
514  The size of the service length should be smaller than 255,
515  Until the simplelink drive supports to variable length through SPI command.
516 
517 
518  */
519 
520  /*Clear the add service bit in the options parameter.
521  In order not use different opcodes for the register service and unregister service
522  bit 31 in option is taken for this purpose. if it is set it means in NWP that the service should be added
523  if it is cleared it means that the service should be deleted and there is only meaning to pServiceName
524  and ServiceNameLen values.*/
525 
526  Options &= (~SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT);
527 
528  return _SlNetAppMDNSRegisterUnregisterService( pServiceName,
529  ServiceNameLen,
530  NULL,
531  0,
532  0,
533  0,
534  Options);
535 
536 
537 }

§ sl_NetAppNdFlush()

_i16 sl_NetAppNdFlush ( )

Flush IPv6 Neighbor Discovery table.

Parameters
[in]None
Returns
Zero on success, or negative error code on failure
See also
sl_NetAppNdFlush
Note
This command flush IPv6 Neighbor Discovery table
Warning
Example

Definition at line 168 of file netapp.c.

169 {
170  /* verify that this api is allowed. if not allowed then
171  ignore the API execution and return immediately with an error */
172  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
173 
174  return _SlDrvBasicCmd(SL_OPCODE_NETAPP_NDFLUSH_V6);
175 }

§ sl_NetAppPing()

_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

Ping uses the ICMP protocol's mandatory ECHO_REQUEST

Parameters
[in]pPingParamsPointer to the ping request structure:
  • If flags parameter is set to 0, ping will report back once all requested pings are done (as defined by TotalNumberOfAttempts).
  • If flags parameter is set to 1, ping will report back after every ping, for TotalNumberOfAttempts.
  • If flags parameter is set to 2, ping will stop after the first successful ping, and report back for the successful ping, as well as any preceding failed ones.
  • If flags parameter is set to 4, for ipv4 - don`t fragment the ping packet. This flag can be set with other flags. For stopping an ongoing ping activity, set parameters IP address to 0
[in]FamilySL_AF_INET or SL_AF_INET6
[out]pReportPing pReport
[out]pPingCallbackCallback function upon completion.
If callback is NULL, the API is blocked until data arrives
Returns
Zero on success, or negative error code on failure.
SL_POOL_IS_EMPTY may be return in case there are no resources in the system In this case try again later or increase MAX_CONCURRENT_ACTIONS
See also
Note
Only one sl_NetAppPing can be handled at a time. Calling this API while the same command is called from another thread, may result in one of the two scenarios:
  1. The command will wait (internal) until the previous command finish, and then be executed.
  2. There are not enough resources and SL_POOL_IS_EMPTY error will return. In this case, MAX_CONCURRENT_ACTIONS can be increased (result in memory increase) or try again later to issue the command.
Warning
Example:
  • Sending 20 ping requests and reporting results to a callback routine when all requests are sent:
    // callback routine
    void pingRes(SlNetAppPingReport_t* pReport)
    {
    // handle ping results
    }
    // ping activation
    void PingTest()
    {
    SlNetAppPingCommand_t pingCommand;
    pingCommand.Ip = SL_IPV4_VAL(10,1,1,200); // destination IP address is 10.1.1.200
    pingCommand.PingSize = 150; // size of ping, in bytes
    pingCommand.PingIntervalTime = 100; // delay between pings, in milliseconds
    pingCommand.PingRequestTimeout = 1000; // timeout for every ping in milliseconds
    pingCommand.TotalNumberOfAttempts = 20; // max number of ping requests. 0 - forever
    pingCommand.Flags = 0; // report only when finished
    sl_NetAppPing( &pingCommand, SL_AF_INET, &report, pingRes );
    }

  • Stopping Ping command:
    Status = sl_NetAppPing(0, 0, 0, 0 );

Definition at line 985 of file netapp.c.

986 {
987  _SlCmdCtrl_t CmdCtrl = {0, (_SlArgSize_t)sizeof(SlNetAppPingCommand_t), (_SlArgSize_t)sizeof(_BasicResponse_t)};
988  _SlPingStartMsg_u Msg;
989  SlPingReportResponse_t PingRsp;
990  _i16 ObjIdx = MAX_CONCURRENT_ACTIONS;
991  _u32 PingTimeout = 0;
992 
993  /* verify that this api is allowed. if not allowed then
994  ignore the API execution and return immediately with an error */
995  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
996 
997  if(NULL != pPingParams)
998  {
999  if(SL_AF_INET == Family)
1000  {
1001  CmdCtrl.Opcode = SL_OPCODE_NETAPP_PINGSTART;
1002  sl_Memcpy(&Msg.Cmd.Ip, &pPingParams->Ip, SL_IPV4_ADDRESS_SIZE);
1003  }
1004  else
1005  {
1006  CmdCtrl.Opcode = SL_OPCODE_NETAPP_PINGSTART_V6;
1007  sl_Memcpy(&Msg.Cmd.Ip, &pPingParams->Ip, SL_IPV6_ADDRESS_SIZE);
1008  }
1009 
1010  Msg.Cmd.PingIntervalTime = pPingParams->PingIntervalTime;
1011  Msg.Cmd.PingSize = pPingParams->PingSize;
1012  Msg.Cmd.PingRequestTimeout = pPingParams->PingRequestTimeout;
1013  Msg.Cmd.TotalNumberOfAttempts = pPingParams->TotalNumberOfAttempts;
1014  Msg.Cmd.Flags = pPingParams->Flags;
1015 
1016 
1017  /* calculate the ping timeout according to the parmas + the guard interval */
1018  PingTimeout = SL_NETAPP_PING_GUARD_INTERVAL + (pPingParams->PingIntervalTime * pPingParams->TotalNumberOfAttempts);
1019 
1020  if (Msg.Cmd.Ip != 0)
1021  {
1022  /* If the following conditions are met, return an error
1023  Wrong ping parameters - ping cannot be called with the following parameters:
1024  1. infinite ping packet
1025  2. report only when finished
1026  3. no callback supplied */
1027  if ((pPingCallback == NULL) && (pPingParams->Flags == 0) && (pPingParams->TotalNumberOfAttempts == 0))
1028  {
1029  return SL_RET_CODE_NET_APP_PING_INVALID_PARAMS;
1030  }
1031 
1032  if( pPingCallback )
1033  {
1034  pPingCallBackFunc = pPingCallback;
1035  }
1036  else
1037  {
1038  /* Use Obj to issue the command, if not available try later */
1039  ObjIdx = _SlDrvWaitForPoolObj(PING_ID,SL_MAX_SOCKETS);
1040  if (MAX_CONCURRENT_ACTIONS == ObjIdx)
1041  {
1042  return SL_POOL_IS_EMPTY;
1043  }
1044  if (SL_RET_CODE_STOP_IN_PROGRESS == ObjIdx)
1045  {
1046  return SL_RET_CODE_STOP_IN_PROGRESS;
1047  }
1048  OSI_RET_OK_CHECK(sl_LockObjLock(&g_pCB->ProtectionLockObj, SL_OS_WAIT_FOREVER));
1049  /* async response handler for non callback mode */
1050  g_pCB->ObjPool[ObjIdx].pRespArgs = (_u8 *)&PingRsp;
1051  pPingCallBackFunc = NULL;
1052  OSI_RET_OK_CHECK(sl_LockObjUnlock(&g_pCB->ProtectionLockObj));
1053  }
1054  }
1055  }
1056  /* Issue Stop Command */
1057  else
1058  {
1059  CmdCtrl.Opcode = SL_OPCODE_NETAPP_PINGSTART;
1060  Msg.Cmd.Ip = 0;
1061  }
1062  /* send the command */
1063  VERIFY_RET_OK(_SlDrvCmdOp(&CmdCtrl, &Msg, NULL));
1064  if (Msg.Cmd.Ip != 0)
1065  {
1066  if(CMD_PING_TEST_RUNNING == (_i16)Msg.Rsp.Status || CMD_PING_TEST_STOPPED == (_i16)Msg.Rsp.Status )
1067  {
1068  /* block waiting for results if no callback function is used */
1069  if( NULL == pPingCallback )
1070  {
1071  VERIFY_RET_OK(_SlDrvWaitForInternalAsyncEvent(ObjIdx, PingTimeout, SL_OPCODE_NETAPP_PINGREPORTREQUESTRESPONSE));
1072 
1073  if( SL_OS_RET_CODE_OK == (_i16)PingRsp.Status )
1074  {
1075  _SlNetAppCopyPingResultsToReport(&PingRsp,pReport);
1076  }
1077  _SlDrvReleasePoolObj(ObjIdx);
1078  }
1079  }
1080  else
1081  { /* ping failure, no async response */
1082  if( NULL == pPingCallback )
1083  {
1084  _SlDrvReleasePoolObj(ObjIdx);
1085  }
1086  }
1087  }
1088  return (_i16)Msg.Rsp.Status;
1089 }

§ sl_NetAppRecv()

_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.e. HTTP POST request)

Parameters
[in]HandleHandle to receive data from. Should match the handle received in the Netapp request event
[in,out]*DataLenMax buffer size (in) / Actual data received (out)
[out]*pDataData received
[in,out]*FlagsCan have the following values:
  • SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION (out)
  • More data is pending in the network processor. Application should continue reading the data by calling sl_NetAppRecv again
Returns
Zero on success, or negative error code on failure
See also
sl_NetAppSend
Note
Warning
handle is received in the sl_NetAppRequestHandler callback. Handle is valid until all data is receive from the network processor.

Definition at line 1250 of file netapp.c.

1251 {
1252  _SlNetAppReceiveMsg_u Msg;
1253  _SlCmdExt_t CmdExt;
1254  SlProtocolNetAppReceive_t AsyncRsp; /* Will be filled when SL_OPCODE_NETAPP_RECEIVE async event is arrived */
1255 
1256  _SlReturnVal_t RetVal;
1257  _i16 ObjIdx = MAX_CONCURRENT_ACTIONS;
1258  _SlArgsData_t pArgsData;
1259 
1260  /* Validate input arguments */
1261  if ((NULL == pData) || (0==DataLen))
1262  {
1263  return SL_ERROR_BSD_EINVAL;
1264  }
1265 
1266  /* Save the user RX bufer. Rx data will be copied into it on the SL_OPCODE_NETAPP_RECEIVE async event */
1267  _SlDrvResetCmdExt(&CmdExt);
1268  CmdExt.RxPayloadLen = *DataLen;
1269  CmdExt.pRxPayload = pData;
1270 
1271  /* Prepare the command args */
1272  Msg.Cmd.Handle = Handle;
1273  Msg.Cmd.MaxBufferLen = *DataLen;
1274  Msg.Cmd.Flags = *Flags;
1275 
1276  /* Use Obj to issue the command, if not available try later */
1277  ObjIdx = _SlDrvWaitForPoolObj(NETAPP_RECEIVE_ID, SL_MAX_SOCKETS);
1278 
1279  if (MAX_CONCURRENT_ACTIONS == ObjIdx)
1280  {
1281  return SL_POOL_IS_EMPTY;
1282  }
1283  if (SL_RET_CODE_STOP_IN_PROGRESS == ObjIdx)
1284  {
1285  return SL_RET_CODE_STOP_IN_PROGRESS;
1286  }
1287 
1288  /* Save the AsyncRsp and cmdExt information for the SL_OPCODE_NETAPP_RECEIVE async event */
1289  AsyncRsp.Handle = Handle; /* Handle we are waiting for */
1290  AsyncRsp.Flags = 0;
1291  AsyncRsp.PayloadLen = 0; /* 0 will indicate an error in the SL_OPCODE_NETAPP_RECEIVE async event and that no data arrived. */
1292 
1293  _SlDrvProtectionObjLockWaitForever();
1294 
1295  pArgsData.pData = (_u8 *) &CmdExt;
1296  pArgsData.pArgs = (_u8 *) &AsyncRsp;
1297 
1298  g_pCB->ObjPool[ObjIdx].pRespArgs = (_u8 *)&pArgsData;
1299 
1300  _SlDrvProtectionObjUnLock();
1301 
1302  /* Send the command */
1303  RetVal = _SlDrvCmdSend((_SlCmdCtrl_t *)&_SlNetAppReceiveCmdCtrl, &Msg, &CmdExt);
1304 
1305  if(SL_OS_RET_CODE_OK == RetVal)
1306  {
1307  /* Wait for SL_OPCODE_NETAPP_RECEIVE async event. Will be signaled by _SlNetAppHandleAsync_NetAppReceive. */
1308  VERIFY_RET_OK(_SlDrvWaitForInternalAsyncEvent(ObjIdx, 0, 0));
1309 
1310  /* Update information for the user */
1311  *DataLen = AsyncRsp.PayloadLen;
1312  *Flags = AsyncRsp.Flags;
1313  }
1314 
1315  _SlDrvReleasePoolObj(ObjIdx);
1316 
1317  return RetVal;
1318 }

§ sl_NetAppSend()

_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)

Parameters
[in]HandleHandle to send the data to. Should match the handle received in the Netapp request event
[in]DataLenData Length
[in]pDataData to send. Can be just data payload or metadata (depends on flags)
[out]FlagsCan have the following values:
  • SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION - More data will arrive in subsequent calls to NetAppSend
  • SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA - 0 - data is payload, 1 - data is metadata
  • SL_NETAPP_REQUEST_RESPONSE_FLAGS_ACCUMULATION - The network processor should accumulate the data chunks and will process it when it is completelly received
Returns
Zero on success, or negative error code on failure
See also
sl_NetAppRecv
Note
Warning

Definition at line 1385 of file netapp.c.

1386 {
1387  _SlNetAppMsgSend_u Msg;
1388  _SlCmdExt_t CmdExt;
1389 
1390  _SlDrvMemZero(&CmdExt, (_u16)sizeof(_SlCmdExt_t));
1391 
1392  if ((((Flags & SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA) == SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA) && (DataLen <= SL_NETAPP_REQUEST_MAX_METADATA_LEN)) ||
1393  (((Flags & SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA) == 0) && (DataLen <= SL_NETAPP_REQUEST_MAX_DATA_LEN)))
1394  {
1395  CmdExt.TxPayload1Len = (DataLen+3) & (~3);
1396  CmdExt.pTxPayload1 = (_u8 *) pData;
1397 
1398  Msg.Cmd.Handle = Handle;
1399  Msg.Cmd.DataLen = DataLen;
1400  Msg.Cmd.Flags = Flags;
1401 
1402  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppSendCmdCtrl, &Msg, &CmdExt));
1403  }
1404  else
1405  {
1406  Msg.Rsp.status = SL_ERROR_BSD_ENOMEM;
1407  }
1408 
1409  return Msg.Rsp.status;
1410 }

§ sl_NetAppSet()

_i16 sl_NetAppSet ( const _u8  AppId,
const _u8  Option,
const _u8  OptionLen,
const _u8 *  pOptionValue 
)

Setting network application configurations.

Parameters
[in]AppIdApplication id, could be one of the following:
  • SL_NETAPP_HTTP_SERVER_ID
  • SL_NETAPP_DHCP_SERVER_ID (AP Role only)
  • SL_NETAPP_MDNS_ID
  • SL_NETAPP_DNS_SERVER_ID
  • SL_NETAPP_DEVICE_ID
  • SL_NETAPP_DNS_CLIENT_ID
[in]OptionSet option, could be one of the following:
  • For SL_NETAPP_HTTP_SERVER_ID
    • SL_NETAPP_HTTP_PRIMARY_PORT_NUMBER
    • SL_NETAPP_HTTP_AUTH_CHECK
    • SL_NETAPP_HTTP_AUTH_NAME
    • SL_NETAPP_HTTP_AUTH_PASSWORD
    • SL_NETAPP_HTTP_AUTH_REALM
    • SL_NETAPP_HTTP_ROM_PAGES_ACCESS
    • SL_NETAPP_HTTP_SECONDARY_PORT_NUMBER
    • SL_NETAPP_HTTP_SECONDARY_PORT_ENABLE
    • SL_NETAPP_HTTP_PRIMARY_PORT_SECURITY_MODE
    • SL_NETAPP_HTTP_PRIVATE_KEY_FILENAME
    • SL_NETAPP_HTTP_DEVICE_CERTIFICATE_FILENAME
    • SL_NETAPP_HTTP_CA_CERTIFICATE_FILE_NAME
    • SL_NETAPP_HTTP_TEMP_REGISTER_MDNS_SERVICE_NAME
    • SL_NETAPP_HTTP_TEMP_UNREGISTER_MDNS_SERVICE_NAME
    • SL_NETAPP_HTTP_TIMEOUT
  • For SL_NETAPP_DHCP_SERVER_ID:
    • SL_NETAPP_DHCP_SRV_BASIC_OPT
  • For SL_NETAPP_MDNS_ID:
    • SL_NETAPP_MDNS_CONT_QUERY_OPT
    • SL_NETAPP_MDNS_QEVETN_MASK_OPT
    • SL_NETAPP_MDNS_TIMING_PARAMS_OPT
  • For SL_NETAPP_DEVICE_ID:
    • SL_NETAPP_DEVICE_URN
    • SL_NETAPP_DEVICE_DOMAIN
    • SL_NETAPP_DEVICE_NAME
  • For SL_NETAPP_DNS_CLIENT_ID:
    • SL_NETAPP_DNS_CLIENT_TIME
    • SL_NETAPP_DNS_CLIENT_CACHE_ENABLE
    • SL_NETAPP_DNS_CLIENT_CACHE_CLEAR
[in]OptionLenOption structure length
[in]pOptionValuePointer to the option structure
Persistent
Reset:
  • SL_NETAPP_DEVICE_DOMAIN
  • SL_NETAPP_DHCP_SRV_BASIC_OPT
Non- Persistent:
  • SL_NETAPP_HTTP_TIMEOUT
  • SL_NETAPP_HTTP_TEMP_REGISTER_MDNS_SERVICE_NAME
  • SL_NETAPP_HTTP_TEMP_UNREGISTER_MDNS_SERVICE_NAME
System Persistent:
  • SL_NETAPP_HTTP_PRIMARY_PORT_NUMBER
  • SL_NETAPP_HTTP_AUTH_CHECK
  • SL_NETAPP_HTTP_AUTH_NAME
  • SL_NETAPP_HTTP_AUTH_PASSWORD
  • SL_NETAPP_HTTP_AUTH_REALM
  • SL_NETAPP_HTTP_ROM_PAGES_ACCESS
  • SL_NETAPP_HTTP_SECONDARY_PORT_NUMBER
  • SL_NETAPP_HTTP_SECONDARY_PORT_ENABLE
  • SL_NETAPP_HTTP_PRIMARY_PORT_SECURITY_MODE
  • SL_NETAPP_HTTP_PRIVATE_KEY_FILENAME
  • SL_NETAPP_HTTP_DEVICE_CERTIFICATE_FILENAME
  • SL_NETAPP_HTTP_CA_CERTIFICATE_FILE_NAME
  • SL_NETAPP_MDNS_CONT_QUERY_OPT
  • SL_NETAPP_MDNS_QEVETN_MASK_OPT
  • SL_NETAPP_MDNS_TIMING_PARAMS_OPT
  • SL_NETAPP_DEVICE_URN
  • SL_NETAPP_DEVICE_ID
  • SL_NETAPP_DNS_CLIENT_ID
Returns
Zero on success, or negative value if an error occurred.
See also
sl_NetAppGet
Note
Warning
Example
  • Setting DHCP Server (AP mode) parameters example:
    _u8 outLen = sizeof(SlNetAppDhcpServerBasicOpt_t);
    dhcpParams.lease_time = 4096; // lease time (in seconds) of the IP Address
    dhcpParams.ipv4_addr_start = SL_IPV4_VAL(192,168,1,10); // first IP Address for allocation. IP Address should be set as Hex number - i.e. 0A0B0C01 for (10.11.12.1)
    dhcpParams.ipv4_addr_last = SL_IPV4_VAL(192,168,1,16); // last IP Address for allocation. IP Address should be set as Hex number - i.e. 0A0B0C01 for (10.11.12.1)
    sl_NetAppStop(SL_NETAPP_DHCP_SERVER_ID); // Stop DHCP server before settings
    sl_NetAppSet(SL_NETAPP_DHCP_SERVER_ID, SL_NETAPP_DHCP_SRV_BASIC_OPT, outLen, (_u8* )&dhcpParams); // set parameters
    sl_NetAppStart(SL_NETAPP_DHCP_SERVER_ID); // Start DHCP server with new settings

  • Setting Device URN name:
    Device name, maximum length of 32 characters Device name affects URN name, and WPS file "device name" in WPS I.E (STA-WPS / P2P) In case no device URN name set, the default name is "mysimplelink" In case of setting the device name with length 0, device will return to default name "mysimplelink" Allowed characters in device name are: 'a - z' , 'A - Z' , '0-9' and '-'
    _u8 *my_device = "MY-SIMPLELINK-DEV";
    sl_NetAppSet (SL_NETAPP_DEVICE_ID, SL_NETAPP_DEVICE_URN, strlen(my_device), (_u8 *) my_device);

  • Register new temporary HTTP service name for MDNS (not persistent):
    _u8 *my_http_temp_name = "New - Bonjour Service Name";
    sl_NetAppSet (SL_NETAPP_HTTP_SERVER_ID, SL_NETAPP_HTTP_TEMP_REGISTER_MDNS_SERVICE_NAME, strlen(my_http_temp_name), (_u8 *) my_http_temp_name);

  • Remove registration of current HTTP internal MDNS service (not persistent) :
    _u8 *old_http_name = "0800285A7891@mysimplelink-022";
    sl_NetAppSet (SL_NETAPP_HTTP_SERVER_ID, SL_NETAPP_HTTP_TEMP_UNREGISTER_MDNS_SERVICE_NAME, strlen(old_http_name), (_u8 *) old_http_name);

  • Set DNS client time example:
    Set DNS client (sl_NetAppDnsGetHostByName) timeout, two parameters max_response_time and number_retries. number_retries: Max number of DNS request before sl_NetAppDnsGetHostByName failed, (up to 100 retries). max_response_time: DNS request timeout changed every retry, it`s start with 100 millisecond and increased every retry up to max_response_time milliseconds, (up to 2 seconds)
    time.MaxResponseTime = 2000;
    time.NumOfRetries = 30;
    sl_NetAppSet (SL_NETAPP_DNS_CLIENT_ID, SL_NETAPP_DNS_CLIENT_TIME, sizeof(time), (_u8 *)&time);

  • Clear the DNS caching:
    sl_NetAppSet (SL_NETAPP_DNS_CLIENT_ID, SL_NETAPP_DNS_CLIENT_CACHE_CLEAR, 0, 0);

  • Enable / Disable the DNS caching:
    By deafult the DNS caching is enabled, set 0 to disable the DNS caching.
    _u8 enabled = 1;
    sl_NetAppSet (SL_NETAPP_DNS_CLIENT_ID, SL_NETAPP_DNS_CLIENT_CACHE_ENABLE,sizeof(enabled),&enabled);

  • Start MDNS continuous querys:
    In a continuous mDNS query mode, the device keeps sending queries to the network according to a specific service name. The query will be sent in IPv4 and IPv6 (if enabled) format. To see the completed list of responding services sl_NetAppGetServiceList() need to be called
    const signed char AddService[40] = "Printer._ipp._tcp.local";
    _i16 Status;
    Status = sl_NetAppSet(SL_NETAPP_MDNS_ID, SL_NETAPP_MDNS_CONT_QUERY_OPT,strlen(AddService) , &AddService);

  • Stop MDNS:
    Status = sl_NetAppSet(SL_NETAPP_MDNS_ID, SL_NETAPP_MDNS_CONT_QUERY_OPT,0 , 0);

  • Set MDNS timing parameters for service advertisement:
    This option allows to control and reconfigures the timing parameters for service advertisement
    _i16 Status;
    Timing.t = 200; // 2 seconds
    Timing.p = 2; // 2 repetitions
    Timing.k = 2; // Telescopic factor 2
    Timing.RetransInterval = 0;
    Timing.Maxinterval = 0xFFFFFFFF;
    Timing.max_time = 5;
    Status = sl_NetAppSet(SL_NETAPP_MDNS_ID, SL_NETAPP_MDNS_TIMING_PARAMS_OPT,sizeof(Timing),&Timing);

  • User-defined service types to monitor:
    In cases that the user decides not to get responses from certain types of services it should set the adapt bit in the event mask that is related to:
    // bit 0: _ipp
    // bit 1: _device-info
    // bit 2: _http
    // bit 3: _https
    // bit 4: _workstation
    // bit 5: _guid
    // bit 6: _h323
    // bit 7: _ntp
    // bit 8: _objective
    // bit 9: _rdp
    // bit 10: _remote
    // bit 11: _rtsp
    // bit 12: _sip
    // bit 13: _smb
    // bit 14: _soap
    // bit 15: _ssh
    // bit 16: _telnet
    // bit 17: _tftp
    // bit 18: _xmpp-client
    // bit 19: _raop
    _u32 EventMask;
    _i16 Status;
    EventMask = BIT0 | BIT1 | BIT18;
    Status = sl_NetAppSet(SL_NETAPP_MDNS_ID, SL_NETAPP_MDNS_QEVETN_MASK_OPT,sizeof(EventMask),&EventMask);

Definition at line 1110 of file netapp.c.

1111 {
1112  _SlNetAppMsgSet_u Msg;
1113  _SlCmdExt_t CmdExt;
1114 
1115  /* verify that this api is allowed. if not allowed then
1116  ignore the API execution and return immediately with an error */
1117  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
1118 
1119  _SlDrvResetCmdExt(&CmdExt);
1120  CmdExt.TxPayload1Len = (OptionLen+3) & (~3);
1121  CmdExt.pTxPayload1 = (_u8 *)pOptionValue;
1122 
1123  Msg.Cmd.AppId = AppId;
1124  Msg.Cmd.ConfigLen = OptionLen;
1125  Msg.Cmd.ConfigOpt = Option;
1126 
1127  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppSetCmdCtrl, &Msg, &CmdExt));
1128 
1129  return (_i16)Msg.Rsp.status;
1130 }

§ sl_NetAppStart()

_i16 sl_NetAppStart ( const _u32  AppBitMap)

Starts a network application.

Gets and starts network application for the current WLAN mode

Parameters
[in]AppBitMapApplication bitmap, could be one or combination of the following:
  • SL_NETAPP_HTTP_SERVER_ID
  • SL_NETAPP_DHCP_SERVER_ID
  • SL_NETAPP_MDNS_ID
  • SL_NETAPP_DNS_SERVER_ID
Persistent - System Persistent
Returns
Zero on success, or negative error code on failure
See also
sl_NetAppStop
Note
This command activates the application for the current WLAN mode (AP or STA)
Warning
Example
  • Starting internal HTTP server + DHCP server:
    sl_NetAppStart(SL_NETAPP_HTTP_SERVER_ID | SL_NETAPP_DHCP_SERVER_ID)

Definition at line 103 of file netapp.c.

104 {
105  _SlNetAppStartStopMsg_u Msg;
106  Msg.Cmd.AppId = AppBitMap;
107 
108  /* verify that this api is allowed. if not allowed then
109  ignore the API execution and return immediately with an error */
110  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
111  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppStartCtrl, &Msg, NULL));
112 
113  return Msg.Rsp.status;
114 }

§ sl_NetAppStop()

_i16 sl_NetAppStop ( const _u32  AppBitMap)

Stops a network application.

Gets and stops network application for the current WLAN mode

Parameters
[in]AppBitMapApplication id, could be one of the following:
  • SL_NETAPP_HTTP_SERVER_ID
  • SL_NETAPP_DHCP_SERVER_ID
  • SL_NETAPP_MDNS_ID
  • SL_NETAPP_DNS_SERVER_ID
Persistent - System Persistent
Returns
Zero on success, or nagative error code on failure
See also
sl_NetAppStart
Note
This command disables the application for the current active WLAN mode (AP or STA)
Warning
Example
  • Stopping internal HTTP server:
    sl_NetAppStop(SL_NETAPP_HTTP_SERVER_ID);

Definition at line 129 of file netapp.c.

130 {
131  _SlNetAppStartStopMsg_u Msg;
132 
133  /* verify that this api is allowed. if not allowed then
134  ignore the API execution and return immediately with an error */
135  VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
136  Msg.Cmd.AppId = AppBitMap;
137  VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppStopCtrl, &Msg, NULL));
138 
139  return Msg.Rsp.status;
140 }

Data Structure Documentation

§ SlIpV4AcquiredAsync_t

struct SlIpV4AcquiredAsync_t

Definition at line 213 of file netapp.h.

Data Fields
_u32 Dns
_u32 Gateway
_u32 Ip

§ SlIpV6AcquiredAsync_t

struct SlIpV6AcquiredAsync_t

Definition at line 226 of file netapp.h.

Data Fields
_u32 Dns[4]
_u32 Ip[4]

§ SlIpLeasedAsync_t

struct SlIpLeasedAsync_t

Definition at line 232 of file netapp.h.

Data Fields
_u32 IpAddress
_u32 LeaseTime
_u8 Mac[6]
_u16 Padding

§ SlIpReleasedAsync_t

struct SlIpReleasedAsync_t

Definition at line 240 of file netapp.h.

Data Fields
_u32 IpAddress
_u8 Mac[6]
_u16 Reason

§ SlIpCollisionAsync_t

struct SlIpCollisionAsync_t

Definition at line 247 of file netapp.h.

Data Fields
_u8 ConflictMac[6]
_u8 DhcpMac[6]
_u32 IpAddress

§ SlNoIpV4CollisionDetectedAsync_t

struct SlNoIpV4CollisionDetectedAsync_t

Definition at line 254 of file netapp.h.

Data Fields
_u16 AddMode
_u32 Ip
_u8 Mac[6]

§ SlNoIpV6CollisionDetectedAsync_t

struct SlNoIpV6CollisionDetectedAsync_t

Definition at line 261 of file netapp.h.

Data Fields
_u16 AddMode
_u32 Ip[4]
_u8 Mac[6]

§ SlIpV4Lost_t

struct SlIpV4Lost_t

Definition at line 270 of file netapp.h.

Data Fields
_u16 Padding
_i16 Status

§ SlIpV6Lost_t

struct SlIpV6Lost_t

Definition at line 276 of file netapp.h.

Data Fields
_u32 IpLost[4]

§ SlDhcpIpAcquireTimeout_t

struct SlDhcpIpAcquireTimeout_t

Definition at line 281 of file netapp.h.

Data Fields
_u16 Padding
_i16 Status

§ SlNetAppEventData_u

union SlNetAppEventData_u

Definition at line 287 of file netapp.h.

Data Fields
SlDhcpIpAcquireTimeout_t DhcpIpAcquireTimeout
SlIpV4AcquiredAsync_t IpAcquiredV4
SlIpV6AcquiredAsync_t IpAcquiredV6
SlIpCollisionAsync_t IpCollision
SlIpLeasedAsync_t IpLeased
SlIpReleasedAsync_t IpReleased
SlNoIpV4CollisionDetectedAsync_t Ipv4CollisionDetected
SlIpV4Lost_t IpV4Lost
SlNoIpV6CollisionDetectedAsync_t Ipv6CollisionDetected
SlIpV6Lost_t IpV6Lost
_u32 Sd

§ SlNetAppEvent_t

struct SlNetAppEvent_t

Definition at line 302 of file netapp.h.

Data Fields
SlNetAppEventData_u Data
_u32 Id

§ SlNetAppPingReport_t

struct SlNetAppPingReport_t

Definition at line 308 of file netapp.h.

Data Fields
_u16 AvgRoundTime
_u16 MaxRoundTime
_u16 MinRoundTime
_u32 PacketsReceived
_u32 PacketsSent
_u32 TestTime

§ SlNetAppPingCommand_t

struct SlNetAppPingCommand_t

Definition at line 318 of file netapp.h.

Data Fields
_u32 Flags
_u32 Ip
_u32 Ip1OrPadding
_u32 Ip2OrPadding
_u32 Ip3OrPadding
_u32 PingIntervalTime
_u16 PingRequestTimeout
_u16 PingSize
_u32 TotalNumberOfAttempts

§ SlNetAppHttpServerString_t

struct SlNetAppHttpServerString_t

Definition at line 331 of file netapp.h.

Data Fields
_u8 Len
_u8 * pData

§ SlNetAppHttpServerData_t

struct SlNetAppHttpServerData_t

Definition at line 337 of file netapp.h.

Data Fields
_u8 NameLen
_u8 * pTokenName
_u8 * pTokenValue
_u8 ValueLen

§ SlNetAppHttpServerPostData_t

struct SlNetAppHttpServerPostData_t

Definition at line 345 of file netapp.h.

Data Fields
SlNetAppHttpServerString_t Action
SlNetAppHttpServerString_t TokenName
SlNetAppHttpServerString_t TokenValue

§ SlNetAppHttpServerEventData_u

union SlNetAppHttpServerEventData_u

Definition at line 352 of file netapp.h.

Data Fields
SlNetAppHttpServerPostData_t HttpPostData
SlNetAppHttpServerString_t HttpTokenName

§ SlNetAppHttpServerResponsedata_u

union SlNetAppHttpServerResponsedata_u

Definition at line 358 of file netapp.h.

Data Fields
SlNetAppHttpServerString_t TokenValue

§ SlNetAppHttpServerEvent_t

struct SlNetAppHttpServerEvent_t

Definition at line 363 of file netapp.h.

Data Fields
_u32 Event
SlNetAppHttpServerEventData_u EventData

§ SlNetAppHttpServerResponse_t

struct SlNetAppHttpServerResponse_t

Definition at line 369 of file netapp.h.

Data Fields
_u32 Response
SlNetAppHttpServerResponsedata_u ResponseData

§ SlNetAppData_t

struct SlNetAppData_t

Definition at line 448 of file netapp.h.

Data Fields
_u32 Flags
_u16 MetadataLen
_u16 PayloadLen
_u8 * pMetadata
_u8 * pPayload

§ SlNetAppRequest_t

struct SlNetAppRequest_t

Definition at line 457 of file netapp.h.

Data Fields
_u8 AppId
_u16 Handle
SlNetAppData_t requestData
_u8 Type

§ SlNetAppResponse_t

struct SlNetAppResponse_t

Definition at line 465 of file netapp.h.

Data Fields
SlNetAppData_t ResponseData
_u16 Status

§ SlNetAppDhcpServerBasicOpt_t

struct SlNetAppDhcpServerBasicOpt_t

Definition at line 471 of file netapp.h.

Data Fields
_u32 ipv4_addr_last
_u32 ipv4_addr_start
_u32 lease_time

§ SlNetAppGetShortServiceIpv4List_t

struct SlNetAppGetShortServiceIpv4List_t

Definition at line 489 of file netapp.h.

Data Fields
_u16 Reserved
_u32 service_ipv4
_u16 service_port

§ SlNetAppGetFullServiceIpv4List_t

struct SlNetAppGetFullServiceIpv4List_t

Definition at line 496 of file netapp.h.

Data Fields
_u16 Reserved
_u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE]
_u32 service_ipv4
_u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE]
_u16 service_port

§ SlNetAppGetFullServiceWithTextIpv4List_t

struct SlNetAppGetFullServiceWithTextIpv4List_t

Definition at line 505 of file netapp.h.

Data Fields
_u16 Reserved
_u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE]
_u32 service_ipv4
_u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE]
_u16 service_port
_u8 service_text[SL_NETAPP_MAX_SERVICE_TEXT_SIZE]

§ SlNetAppGetShortServiceIpv6List_t

struct SlNetAppGetShortServiceIpv6List_t

Definition at line 516 of file netapp.h.

Data Fields
_u16 Reserved
_u32 service_ipv6[4]
_u16 service_port

§ SlNetAppGetFullServiceIpv6List_t

struct SlNetAppGetFullServiceIpv6List_t

Definition at line 523 of file netapp.h.

Data Fields
_u16 Reserved
_u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE]
_u32 service_ipv6[4]
_u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE]
_u16 service_port

§ SlNetAppGetFullServiceWithTextIpv6List_t

struct SlNetAppGetFullServiceWithTextIpv6List_t

Definition at line 532 of file netapp.h.

Data Fields
_u16 Reserved
_u8 service_host[SL_NETAPP_MAX_SERVICE_HOST_NAME_SIZE]
_u32 service_ipv6[4]
_u8 service_name[SL_NETAPP_MAX_SERVICE_NAME_SIZE]
_u16 service_port
_u8 service_text[SL_NETAPP_MAX_SERVICE_TEXT_SIZE]

§ SlNetAppServiceAdvertiseTimingParameters_t

struct SlNetAppServiceAdvertiseTimingParameters_t

Definition at line 542 of file netapp.h.

Data Fields
_u32 k
_u32 max_time
_u32 Maxinterval
_u32 p
_u32 RetransInterval
_u32 t

§ SlNetAppDnsClientTime_t

struct SlNetAppDnsClientTime_t

Definition at line 566 of file netapp.h.

Data Fields
_u16 MaxResponseTime
_u16 NumOfRetries