XFusion API v1.3.0
|
netif 接口。 更多...
函数 | |
xf_err_t | xf_netif_set_hostname (xf_netif_t netif_hdl, const char *hostname, uint32_t len) |
设置当前 netif 句柄对应的主机名。 | |
xf_err_t | xf_netif_get_hostname (xf_netif_t netif_hdl, char hostname[], uint32_t len) |
获取当前 netif 句柄对应的主机名。 | |
bool | xf_netif_is_netif_up (xf_netif_t netif_hdl) |
检测当前 netif 句柄对应设备是否上线。 | |
xf_err_t | xf_netif_get_ip_info (xf_netif_t netif_hdl, xf_netif_ip_info_t *ip_info) |
获取指定 netif 句柄的 IPv4 信息(ip地址、网关、子网掩码)。 | |
xf_err_t | xf_netif_set_ip_info (xf_netif_t netif_hdl, const xf_netif_ip_info_t *ip_info) |
设置指定 netif 句柄的 IPv4 信息(ip地址、网关、子网掩码)。 | |
xf_err_t | xf_netif_dhcpc_start (xf_netif_t netif_hdl) |
设置指定 netif 句柄启动 DHCP 客户端。 | |
xf_err_t | xf_netif_dhcpc_stop (xf_netif_t netif_hdl) |
设置指定 netif 句柄停止 DHCP 客户端。 | |
xf_err_t | xf_netif_dhcps_start (xf_netif_t netif_hdl) |
设置指定 netif 句柄启动 DHCP 服务端。 | |
xf_err_t | xf_netif_dhcps_stop (xf_netif_t netif_hdl) |
设置指定 netif 句柄停止 DHCP 服务端。 | |
xf_err_t | xf_netif_dhcps_get_clients_by_mac (xf_netif_t netif_hdl, xf_netif_pair_mac_ip_t mac_ip_pair_array[], uint32_t pair_array_size) |
根据 MAC 地址获取对应的 IP(对于 DHCP 服务器)。 | |
xf_err_t | xf_netif_set_dns_info (xf_netif_t netif_hdl, xf_netif_dns_type_t type, xf_netif_dns_info_t *dns) |
设置指定 netif 句柄的 DNS 服务端。 | |
xf_err_t | xf_netif_get_dns_info (xf_netif_t netif_hdl, xf_netif_dns_type_t type, xf_netif_dns_info_t *dns) |
从指定 netif 句柄获取的 DNS 服务端信息。 | |
netif 接口。
xf_err_t xf_netif_set_hostname | ( | xf_netif_t | netif_hdl, |
const char * | hostname, | ||
uint32_t | len | ||
) |
设置当前 netif 句柄对应的主机名。
netif_hdl | netif 句柄。 |
hostname | 主机名。必须随时可读取! |
len | 主机名的长度。 |
xf_err_t xf_netif_get_hostname | ( | xf_netif_t | netif_hdl, |
char | hostname[], | ||
uint32_t | len | ||
) |
获取当前 netif 句柄对应的主机名。
netif_hdl | netif 句柄。 | |
[out] | hostname | 传出主机名字符串。 |
len | 主机名字符串数组最大长度。如果 hostname 过小可能导致截断。 |
bool xf_netif_is_netif_up | ( | xf_netif_t | netif_hdl | ) |
检测当前 netif 句柄对应设备是否上线。
netif_hdl | netif 句柄。 |
xf_err_t xf_netif_get_ip_info | ( | xf_netif_t | netif_hdl, |
xf_netif_ip_info_t * | ip_info | ||
) |
获取指定 netif 句柄的 IPv4 信息(ip地址、网关、子网掩码)。
netif_hdl | netif 句柄。 | |
[out] | ip_info | 传出 IPv4 信息。 |
xf_err_t xf_netif_set_ip_info | ( | xf_netif_t | netif_hdl, |
const xf_netif_ip_info_t * | ip_info | ||
) |
设置指定 netif 句柄的 IPv4 信息(ip地址、网关、子网掩码)。
netif_hdl | netif 句柄。 |
ip_info | 要设置的 IPv4 信息 |
xf_err_t xf_netif_dhcpc_start | ( | xf_netif_t | netif_hdl | ) |
设置指定 netif 句柄启动 DHCP 客户端。
netif_hdl | netif 句柄。 |
xf_err_t xf_netif_dhcpc_stop | ( | xf_netif_t | netif_hdl | ) |
设置指定 netif 句柄停止 DHCP 客户端。
netif_hdl | netif 句柄。 |
xf_err_t xf_netif_dhcps_start | ( | xf_netif_t | netif_hdl | ) |
设置指定 netif 句柄启动 DHCP 服务端。
netif_hdl | netif 句柄。 |
xf_err_t xf_netif_dhcps_stop | ( | xf_netif_t | netif_hdl | ) |
设置指定 netif 句柄停止 DHCP 服务端。
netif_hdl | netif 句柄。 |
xf_err_t xf_netif_dhcps_get_clients_by_mac | ( | xf_netif_t | netif_hdl, |
xf_netif_pair_mac_ip_t | mac_ip_pair_array[], | ||
uint32_t | pair_array_size | ||
) |
根据 MAC 地址获取对应的 IP(对于 DHCP 服务器)。
netif_hdl | netif 句柄。 |
mac_ip_pair_array | MAC 和 IP 地址对的数组(MAC 是输入,IP 输出)。 |
pair_array_size | 数组大小,单位:个。 |
xf_err_t xf_netif_set_dns_info | ( | xf_netif_t | netif_hdl, |
xf_netif_dns_type_t | type, | ||
xf_netif_dns_info_t * | dns | ||
) |
设置指定 netif 句柄的 DNS 服务端。
netif_hdl | netif 句柄。 |
type | DNS 服务器类型。 |
dns | DNS 服务器信息。 |
xf_err_t xf_netif_get_dns_info | ( | xf_netif_t | netif_hdl, |
xf_netif_dns_type_t | type, | ||
xf_netif_dns_info_t * | dns | ||
) |
从指定 netif 句柄获取的 DNS 服务端信息。
netif_hdl | netif 句柄。 | |
type | DNS 服务器类型。 | |
[out] | dns | DNS 服务器信息。 |