harmony 鸿蒙net_connection_type.h

  • 2025-06-12
  • 浏览 (6)

net_connection_type.h

Overview

Declares the structs for the C APIs of the network connection module.

Library: libnet_connection.so

System capability: SystemCapability.Communication.NetManager.Core

Since: 11

Related module: NetConnection

Summary

Structs

Name Description
NetConn_NetHandle Network ID.
NetConn_NetCapabilities Network capability set.
NetConn_NetAddr Network address.
NetConn_Route Route configuration:
NetConn_HttpProxy Proxy configuration information.
NetConn_ConnectionProperties Network connection information.
NetConn_NetHandleList Network list.
NetConn_NetConnCallback Network status callback.
NetConn_NetSpecifier Network specifier, including a network capability set and a network ID.

Macros

Name Description
NETCONN_MAX_NET_SIZE 32
NETCONN_MAX_BEARER_TYPE_SIZE 32
NETCONN_MAX_CAP_SIZE 32
NETCONN_MAX_ADDR_SIZE 32
NETCONN_MAX_ROUTE_SIZE 64
NETCONN_MAX_EXCLUSION_SIZE 256
NETCONN_MAX_STR_LEN 256

Types

Name Description
NetConn_NetCap Network capability set.
NetConn_NetBearerType Network carrier type.
NetConn_NetHandle Network ID.
NetConn_NetCapabilities Network capability set.
NetConn_NetAddr Network address.
NetConn_Route Route configuration:
NetConn_HttpProxy Proxy configuration information.
NetConn_ConnectionProperties Network connection information.
NetConn_NetHandleList Network list.
(*OH_NetConn_CustomDnsResolver) (const char *host, const char *serv, const struct addrinfo *hint, struct addrinfo **res) Pointer to the custom DNS resolver.
NetConn_ErrorCode Network connection error code.

Enums

Name Description
NetConn_NetCap {
NETCONN_NET_CAPABILITY_MMS = 0,
NETCONN_NET_CAPABILITY_NOT_METERED = 11,
NETCONN_NET_CAPABILITY_INTERNET = 12,
NETCONN_NET_CAPABILITY_NOT_VPN = 15,
NETCONN_NET_CAPABILITY_VALIDATED = 16
}
Network capability set.
NetConn_NetBearerType {
NETCONN_BEARER_CELLULAR = 0,
NETCONN_BEARER_WIFI = 1,
NETCONN_BEARER_ETHERNET = 3
NETCONN_BEARER_VPN = 4
}
Network carrier type.
NetConn_ErrorCode {
NETCONN_SUCCESS = 0,
NETCONN_PERMISSION_DENIED = 201,
NETCONN_PARAMETER_ERROR = 401,
NETCONN_OPERATION_FAILED = 2100002,
NETCONN_INTERNAL_ERROR = 2100003
}
Network connection error code.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Network Kit

harmony 鸿蒙NetConn_ConnectionProperties

harmony 鸿蒙NetConn_HttpProxy

harmony 鸿蒙NetConn_NetAddr

harmony 鸿蒙NetConn_NetCapabilities

harmony 鸿蒙NetConn_NetConnCallback

harmony 鸿蒙NetConn_NetHandle

harmony 鸿蒙NetConn_NetHandleList

harmony 鸿蒙NetConn_NetSpecifier

harmony 鸿蒙NetConn_Route

0  赞