Network utilities; common networking support functions. More...
Go to the source code of this file.
Data Structures | |
struct | qsc_netutils_adaptor_info |
The netutils adaptor info structure. More... | |
Macros | |
#define | QSC_NETUTILS_ADAPTOR_NAME_SIZE 0x104U |
#define | QSC_NETUTILS_ADAPTOR_DESCRIPTION_SIZE 0x84U |
#define | QSC_NETUTILS_ADAPTOR_INFO_ARRAY_SIZE 0x08U |
#define | QSC_NETUTILS_DOMAIN_NAME_SIZE 0x104U |
#define | QSC_NETUTILS_HOSTS_NAME_SIZE 0x104U |
#define | QSC_NETUTILS_IP_STRING_SIZE 0x80U |
#define | QSC_NETUTILS_MAC_ADDRESS_SIZE 0x12U |
#define | QSC_NETUTILS_NAME_BUFFER_SIZE 0x80U |
#define | QSC_NETUTILS_SERVICE_NAME_BUFFER_SIZE 0x80U |
#define | QSC_NETUTILS_SUBNET_STRING_SIZE 0x10U |
Functions | |
QSC_EXPORT_API void | qsc_netutils_get_adaptor_info (qsc_netutils_adaptor_info *info, const char *infname) |
Retrieves the address information on a named addressable interface. | |
QSC_EXPORT_API void | qsc_netutils_get_mac_address (uint8_t mac[QSC_NETUTILS_MAC_ADDRESS_SIZE]) |
Retrieves the mac address of the primary interface. | |
QSC_EXPORT_API uint32_t | qsc_netutils_atoi (const char *source) |
Parse a string for a number. | |
QSC_EXPORT_API size_t | qsc_netutils_get_domain_name (char output[QSC_NETUTILS_DOMAIN_NAME_SIZE]) |
Retrieves the hosts domain name. | |
QSC_EXPORT_API bool | qsc_netutils_get_host_name (char host[QSC_NETUTILS_HOSTS_NAME_SIZE]) |
Retrieves the host name of the local machine. | |
QSC_EXPORT_API void | qsc_netutils_get_name_from_ipv4_address (const qsc_ipinfo_ipv4_address *address, char host[QSC_NETUTILS_HOSTS_NAME_SIZE]) |
Retrieves fully qualified name from an IPv4 address. | |
QSC_EXPORT_API bool | qsc_netutils_get_ipv4_address (qsc_ipinfo_ipv4_address *padd) |
Retrieves the local IPv4 address. | |
QSC_EXPORT_API bool | qsc_netutils_get_ipv6_address (qsc_ipinfo_ipv6_address *padd) |
Retrieves the local IPv6 address. | |
QSC_EXPORT_API void | qsc_netutils_get_ipv4_info (qsc_ipinfo_ipv4_info *pinfo, const char *host, const char *service) |
Retrieves the IPv4 address information for a remote host. | |
QSC_EXPORT_API void | qsc_netutils_get_ipv6_info (qsc_ipinfo_ipv6_info *pinfo, const char *host, const char *service) |
Retrieves the IPv6 address information for a remote host. | |
QSC_EXPORT_API void | qsc_netutils_get_peer_name (char output[QSC_NETUTILS_HOSTS_NAME_SIZE], const qsc_socket *sock) |
Retrieves the host name of the connected peer. | |
QSC_EXPORT_API void | qsc_netutils_get_socket_name (char output[QSC_NETUTILS_NAME_BUFFER_SIZE], const qsc_socket *sock) |
Retrieves the socket name of the connected peer. | |
QSC_EXPORT_API uint16_t | qsc_netutils_port_name_to_number (const char *portname, const char *protocol) |
Get the port number using the connection parameters. | |
Network utilities; common networking support functions.
This header provides utility functions for common networking tasks, including socket creation, connection management, data transmission, and reception over TCP/IP. The implementation supports both Microsoft Windows and POSIX-compliant systems, ensuring cross-platform compatibility with the underlying networking protocols.
#define QSC_NETUTILS_ADAPTOR_DESCRIPTION_SIZE 0x84U |
The network adaptors description string
#define QSC_NETUTILS_ADAPTOR_INFO_ARRAY_SIZE 0x08U |
The network adaptors info array size
#define QSC_NETUTILS_ADAPTOR_NAME_SIZE 0x104U |
The network adaptors info string
#define QSC_NETUTILS_DOMAIN_NAME_SIZE 0x104U |
The size of the domain name buffer
#define QSC_NETUTILS_HOSTS_NAME_SIZE 0x104U |
The size of the hosts name buffer
#define QSC_NETUTILS_IP_STRING_SIZE 0x80U |
The IP address string size
#define QSC_NETUTILS_MAC_ADDRESS_SIZE 0x12U |
The MAC address buffer length
#define QSC_NETUTILS_NAME_BUFFER_SIZE 0x80U |
The size of the protocol name buffer
#define QSC_NETUTILS_SERVICE_NAME_BUFFER_SIZE 0x80U |
The size of the service name buffer
#define QSC_NETUTILS_SUBNET_STRING_SIZE 0x10U |
The size of the subnet string
QSC_EXPORT_API uint32_t qsc_netutils_atoi | ( | const char * | source | ) |
Parse a string for a number.
source | [const char*] The string to convert |
QSC_EXPORT_API void qsc_netutils_get_adaptor_info | ( | qsc_netutils_adaptor_info * | info, |
const char * | infname ) |
Retrieves the address information on a named addressable interface.
info | [qsc_netutils_adaptor_info*] The adaptor info structure |
infname | [const char*]The adaptor interface name, ex 'eth0' or 'wlan0' |
QSC_EXPORT_API size_t qsc_netutils_get_domain_name | ( | char | output[QSC_NETUTILS_DOMAIN_NAME_SIZE] | ) |
Retrieves the hosts domain name.
output | [char*] The source socket instance |
QSC_EXPORT_API bool qsc_netutils_get_host_name | ( | char | host[QSC_NETUTILS_HOSTS_NAME_SIZE] | ) |
Retrieves the host name of the local machine.
host | [char*] The host-name string |
QSC_EXPORT_API bool qsc_netutils_get_ipv4_address | ( | qsc_ipinfo_ipv4_address * | padd | ) |
Retrieves the local IPv4 address.
padd | [qsc_ipinfo_ipv4_address*] The ipv6 address structure |
QSC_EXPORT_API void qsc_netutils_get_ipv4_info | ( | qsc_ipinfo_ipv4_info * | pinfo, |
const char * | host, | ||
const char * | service ) |
Retrieves the IPv4 address information for a remote host.
pinfo | [qsc_ipinfo_ipv4_info*] A pointer to the output ipinfo structure |
host | [const char*] The hosts qualified name |
service | [const char*] The service name |
QSC_EXPORT_API bool qsc_netutils_get_ipv6_address | ( | qsc_ipinfo_ipv6_address * | padd | ) |
Retrieves the local IPv6 address.
padd | [qsc_ipinfo_ipv6_address*] The ipv6 address structure |
QSC_EXPORT_API void qsc_netutils_get_ipv6_info | ( | qsc_ipinfo_ipv6_info * | pinfo, |
const char * | host, | ||
const char * | service ) |
Retrieves the IPv6 address information for a remote host.
pinfo | [qsc_ipinfo_ipv6_info*] A pointer to the output ipinfo structure |
host | [const char*] The hosts qualified name |
service | [const char*] The service name |
QSC_EXPORT_API void qsc_netutils_get_mac_address | ( | uint8_t | mac[QSC_NETUTILS_MAC_ADDRESS_SIZE] | ) |
Retrieves the mac address of the primary interface.
mac | [uint8_t*] The output array receiving the MAC address |
QSC_EXPORT_API void qsc_netutils_get_name_from_ipv4_address | ( | const qsc_ipinfo_ipv4_address * | address, |
char | host[QSC_NETUTILS_HOSTS_NAME_SIZE] ) |
Retrieves fully qualified name from an IPv4 address.
address | [const qsc_ipinfo_ipv4_address*] The input IPv4 address string |
host | [char*] The output host name |
QSC_EXPORT_API void qsc_netutils_get_peer_name | ( | char | output[QSC_NETUTILS_HOSTS_NAME_SIZE], |
const qsc_socket * | sock ) |
Retrieves the host name of the connected peer.
output | [char*] The output buffer |
sock | [const char*] The source socket instance |
QSC_EXPORT_API void qsc_netutils_get_socket_name | ( | char | output[QSC_NETUTILS_NAME_BUFFER_SIZE], |
const qsc_socket * | sock ) |
Retrieves the socket name of the connected peer.
output | [char*] The output buffer |
sock | [const qsc_socket*] The source socket instance |
QSC_EXPORT_API uint16_t qsc_netutils_port_name_to_number | ( | const char * | portname, |
const char * | protocol ) |
Get the port number using the connection parameters.
portname | [const char*] The port name |
protocol | [const char*] The protocol name |