41 #include "simplelink.h"
65 #define SL_ERROR_NETAPP_RX_BUFFER_LENGTH_ERROR (-230)
68 #define MAX_INPUT_STRING (64)
70 #define MAX_AUTH_NAME_LEN (20)
71 #define MAX_AUTH_PASSWORD_LEN (20)
72 #define MAX_AUTH_REALM_LEN (20)
74 #define MAX_DEVICE_URN_LEN (15+1)
75 #define MAX_DOMAIN_NAME_LEN (24+1)
77 #define MAX_ACTION_LEN (30)
79 #define MAX_TOKEN_NAME_LEN (20)
80 #define MAX_TOKEN_VALUE_LEN MAX_INPUT_STRING
82 #define NETAPP_MAX_SERVICE_TEXT_SIZE (256)
83 #define NETAPP_MAX_SERVICE_NAME_SIZE (60)
84 #define NETAPP_MAX_SERVICE_HOST_NAME_SIZE (64)
88 #define SL_NETAPP_RESPONSE_NONE (0)
89 #define SL_NETAPP_HTTPSETTOKENVALUE (1)
91 #define SL_NETAPP_FAMILY_MASK (0x80)
94 #define SL_NET_APP_MASK_IPP_TYPE_OF_SERVICE (0x00000001)
95 #define SL_NET_APP_MASK_DEVICE_INFO_TYPE_OF_SERVICE (0x00000002)
96 #define SL_NET_APP_MASK_HTTP_TYPE_OF_SERVICE (0x00000004)
97 #define SL_NET_APP_MASK_HTTPS_TYPE_OF_SERVICE (0x00000008)
98 #define SL_NET_APP_MASK_WORKSATION_TYPE_OF_SERVICE (0x00000010)
99 #define SL_NET_APP_MASK_GUID_TYPE_OF_SERVICE (0x00000020)
100 #define SL_NET_APP_MASK_H323_TYPE_OF_SERVICE (0x00000040)
101 #define SL_NET_APP_MASK_NTP_TYPE_OF_SERVICE (0x00000080)
102 #define SL_NET_APP_MASK_OBJECITVE_TYPE_OF_SERVICE (0x00000100)
103 #define SL_NET_APP_MASK_RDP_TYPE_OF_SERVICE (0x00000200)
104 #define SL_NET_APP_MASK_REMOTE_TYPE_OF_SERVICE (0x00000400)
105 #define SL_NET_APP_MASK_RTSP_TYPE_OF_SERVICE (0x00000800)
106 #define SL_NET_APP_MASK_SIP_TYPE_OF_SERVICE (0x00001000)
107 #define SL_NET_APP_MASK_SMB_TYPE_OF_SERVICE (0x00002000)
108 #define SL_NET_APP_MASK_SOAP_TYPE_OF_SERVICE (0x00004000)
109 #define SL_NET_APP_MASK_SSH_TYPE_OF_SERVICE (0x00008000)
110 #define SL_NET_APP_MASK_TELNET_TYPE_OF_SERVICE (0x00010000)
111 #define SL_NET_APP_MASK_TFTP_TYPE_OF_SERVICE (0x00020000)
112 #define SL_NET_APP_MASK_XMPP_CLIENT_TYPE_OF_SERVICE (0x00040000)
113 #define SL_NET_APP_MASK_RAOP_TYPE_OF_SERVICE (0x00080000)
114 #define SL_NET_APP_MASK_ALL_TYPE_OF_SERVICE (0xFFFFFFFF)
119 #define SL_NET_APP_DNS_QUERY_NO_RESPONSE (-159)
120 #define SL_NET_APP_DNS_NO_SERVER (-161)
121 #define SL_NET_APP_DNS_PARAM_ERROR (-162)
122 #define SL_NET_APP_DNS_QUERY_FAILED (-163)
123 #define SL_NET_APP_DNS_INTERNAL_1 (-164)
124 #define SL_NET_APP_DNS_INTERNAL_2 (-165)
125 #define SL_NET_APP_DNS_MALFORMED_PACKET (-166)
126 #define SL_NET_APP_DNS_INTERNAL_3 (-167)
127 #define SL_NET_APP_DNS_INTERNAL_4 (-168)
128 #define SL_NET_APP_DNS_INTERNAL_5 (-169)
129 #define SL_NET_APP_DNS_INTERNAL_6 (-170)
130 #define SL_NET_APP_DNS_INTERNAL_7 (-171)
131 #define SL_NET_APP_DNS_INTERNAL_8 (-172)
132 #define SL_NET_APP_DNS_INTERNAL_9 (-173)
133 #define SL_NET_APP_DNS_MISMATCHED_RESPONSE (-174)
134 #define SL_NET_APP_DNS_INTERNAL_10 (-175)
135 #define SL_NET_APP_DNS_INTERNAL_11 (-176)
136 #define SL_NET_APP_DNS_NO_ANSWER (-177)
137 #define SL_NET_APP_DNS_NO_KNOWN_ANSWER (-178)
138 #define SL_NET_APP_DNS_NAME_MISMATCH (-179)
139 #define SL_NET_APP_DNS_NOT_STARTED (-180)
140 #define SL_NET_APP_DNS_HOST_NAME_ERROR (-181)
141 #define SL_NET_APP_DNS_NO_MORE_ENTRIES (-182)
143 #define SL_NET_APP_DNS_MAX_SERVICES_ERROR (-200)
144 #define SL_NET_APP_DNS_IDENTICAL_SERVICES_ERROR (-201)
145 #define SL_NET_APP_DNS_NOT_EXISTED_SERVICE_ERROR (-203)
146 #define SL_NET_APP_DNS_ERROR_SERVICE_NAME_ERROR (-204)
147 #define SL_NET_APP_DNS_RX_PACKET_ALLOCATION_ERROR (-205)
148 #define SL_NET_APP_DNS_BUFFER_SIZE_ERROR (-206)
149 #define SL_NET_APP_DNS_NET_APP_SET_ERROR (-207)
150 #define SL_NET_APP_DNS_GET_SERVICE_LIST_FLAG_ERROR (-208)
151 #define SL_NET_APP_DNS_NO_CONFIGURATION_ERROR (-209)
154 #define SL_ERROR_DEVICE_NAME_LEN_ERR (-117)
155 #define SL_ERROR_DEVICE_NAME_INVALID (-118)
157 #define SL_ERROR_DOMAIN_NAME_LEN_ERR (-119)
158 #define SL_ERROR_DOMAIN_NAME_INVALID (-120)
163 #define SL_NET_APP_HTTP_SERVER_ID (1)
164 #define SL_NET_APP_DHCP_SERVER_ID (2)
165 #define SL_NET_APP_MDNS_ID (4)
166 #define SL_NET_APP_DNS_SERVER_ID (8)
167 #define SL_NET_APP_DEVICE_CONFIG_ID (16)
169 #define NETAPP_SET_DHCP_SRV_BASIC_OPT (0)
171 #define NETAPP_SET_GET_HTTP_OPT_PORT_NUMBER (0)
172 #define NETAPP_SET_GET_HTTP_OPT_AUTH_CHECK (1)
173 #define NETAPP_SET_GET_HTTP_OPT_AUTH_NAME (2)
174 #define NETAPP_SET_GET_HTTP_OPT_AUTH_PASSWORD (3)
175 #define NETAPP_SET_GET_HTTP_OPT_AUTH_REALM (4)
176 #define NETAPP_SET_GET_HTTP_OPT_ROM_PAGES_ACCESS (5)
178 #define NETAPP_SET_GET_MDNS_CONT_QUERY_OPT (1)
179 #define NETAPP_SET_GET_MDNS_QEVETN_MASK_OPT (2)
180 #define NETAPP_SET_GET_MDNS_TIMING_PARAMS_OPT (3)
183 #define NETAPP_SET_GET_DNS_OPT_DOMAIN_NAME (0)
186 #define NETAPP_SET_GET_DEV_CONF_OPT_DEVICE_URN (0)
187 #define NETAPP_SET_GET_DEV_CONF_OPT_DOMAIN_NAME (1)
197 _u32 PacketsReceived;
206 _u32 PingIntervalTime;
208 _u16 PingRequestTimeout;
209 _u32 TotalNumberOfAttempts;
265 _u32 ipv4_addr_start;
272 SL_NET_APP_FULL_SERVICE_WITH_TEXT_IPV4_TYPE = 1,
273 SL_NET_APP_FULL_SERVICE_IPV4_TYPE,
274 SL_NET_APP_SHORT_SERVICE_IPV4_TYPE
276 } SlNetAppGetServiceListType_e;
290 _u8 service_name[NETAPP_MAX_SERVICE_NAME_SIZE];
291 _u8 service_host[NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
299 _u8 service_name[NETAPP_MAX_SERVICE_NAME_SIZE];
300 _u8 service_host[NETAPP_MAX_SERVICE_HOST_NAME_SIZE];
301 _u8 service_text[NETAPP_MAX_SERVICE_TEXT_SIZE];
323 _u32 RetransInterval;
360 #if _SL_INCLUDE_FUNC(sl_NetAppStart)
386 #if _SL_INCLUDE_FUNC(sl_NetAppStop)
436 #if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByName)
495 #if _SL_INCLUDE_FUNC(sl_NetAppDnsGetHostByService)
497 const _u8 ServiceLen,
555 #if _SL_INCLUDE_FUNC(sl_NetAppGetServiceList)
557 const _u8 MaxServiceCount,
560 const _u32 RxBufferLength
588 #if _SL_INCLUDE_FUNC(sl_NetAppMDNSUnRegisterService)
656 #if _SL_INCLUDE_FUNC(sl_NetAppMDNSRegisterService)
658 const _u8 ServiceNameLen,
726 #if _SL_INCLUDE_FUNC(sl_NetAppPingStart)
793 #if _SL_INCLUDE_FUNC(sl_NetAppSet)
794 _i32
sl_NetAppSet(
const _u8 AppId ,
const _u8 Option,
const _u8 OptionLen,
const _u8 *pOptionValue);
865 #if _SL_INCLUDE_FUNC(sl_NetAppGet)
866 _i32
sl_NetAppGet(
const _u8 AppId,
const _u8 Option,_u8 *pOptionLen, _u8 *pOptionValue);
_i16 sl_NetAppStop(const _u32 AppBitMap)
Stops a network application.
_i16 sl_NetAppDnsGetHostByName(_i8 *hostname, const _u16 usNameLen, _u32 *out_ip_addr, const _u8 family)
Get host IP by name.
_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.
_i32 sl_NetAppSet(const _u8 AppId, const _u8 Option, const _u8 OptionLen, const _u8 *pOptionValue)
Internal function for setting network application configurations.
_i32 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.
_i16 sl_NetAppMDNSUnRegisterService(const _i8 *pServiceName, const _u8 ServiceNameLen)
Unregister mDNS service This function deletes the mDNS service from the mDNS package and the database...
_i16 sl_NetAppStart(const _u32 AppBitMap)
Starts a network application.
_i16 sl_NetAppGetServiceList(const _u8 IndexOffest, const _u8 MaxServiceCount, const _u8 Flags, _i8 *pBuffer, const _u32 RxBufferLength)
Get service List Insert into out pBuffer a list of peer's services that are the NWP. The list is in a form of service struct. The user should chose the type of the service struct like:
_i32 sl_NetAppGet(const _u8 AppId, const _u8 Option, _u8 *pOptionLen, _u8 *pOptionValue)
Internal function for getting network applications configurations.
_i16 sl_NetAppPingStart(const SlPingStartCommand_t *pPingParams, const _u8 family, SlPingReport_t *pReport, const P_SL_DEV_PING_CALLBACK pPingCallback)
send ICMP ECHO_REQUEST to network hosts