Activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS.
More...
|
_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...
|
|
|
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
} |
|
Activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS.
_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:
- PC1._ipp._tcp.local
- 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] | ServiceNameLen | The length of the service. |
[in] | TextLen | The length of the service should be smaller than 64. |
[in] | Port | The port on this target host port. |
[in] | TTL | The TTL of the service |
[in] | Options | bitwise 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] | pServiceName | The service name. |
[in] | pText | The 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.
463 VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
485 Options |= SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT;
487 return _SlNetAppMDNSRegisterUnregisterService(pServiceName,
_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:
- PC1._ipp._tcp.local
- PC2_server._ftp._tcp.local
- Parameters
-
[in] | pServiceName | Full service name.
|
[in] | ServiceNameLen | The length of the service. |
[in] | Options | bitwise 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.
508 VERIFY_API_ALLOWED(SL_OPCODE_SILO_NETAPP);
526 Options &= (~SL_NETAPP_MDNS_OPTIONS_ADD_SERVICE_BIT);
528 return _SlNetAppMDNSRegisterUnregisterService( pServiceName,