acl/lib_acl/include/net/acl_ifconf.h

52 lines
1.1 KiB
C
Raw Normal View History

#ifndef ACL_IFCONF_INCLUDE_H
#define ACL_IFCONF_INCLUDE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stdlib/acl_define.h"
typedef struct ACL_IFADDR {
char *name; /* <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> */
#ifdef WIN32
char *desc; /* <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> */
#endif
char ip[32]; /* <20><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>IP<49><50>ַ */
unsigned int addr; /* <20><><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD> 32 λ IP <20><>ַ */
} ACL_IFADDR;
typedef struct ACL_IFCONF {
ACL_IFADDR *addrs; /* ACL_IFADDR <20><><EFBFBD><EFBFBD> */
int length; /* ACL_IFADDR <20><><EFBFBD><EFBFBD><E9B3A4> */
/* for acl_iterator */
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD> */
const ACL_IFADDR *(*iter_head)(ACL_ITER*, struct ACL_IFCONF*);
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
const ACL_IFADDR *(*iter_next)(ACL_ITER*, struct ACL_IFCONF*);
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2><EFBFBD><EFBFBD> */
const ACL_IFADDR *(*iter_tail)(ACL_ITER*, struct ACL_IFCONF*);
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
const ACL_IFADDR *(*iter_prev)(ACL_ITER*, struct ACL_IFCONF*);
} ACL_IFCONF;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {ACL_IFCONF*}
*/
ACL_API ACL_IFCONF *acl_get_ifaddrs(void);
/**
* <EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD> acl_get_ifaddrs() <EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD> ACL_IFCONF <EFBFBD>ڴ<EFBFBD>
* @param ifconf {ACL_IFCONF*}
*/
ACL_API void acl_free_ifaddrs(ACL_IFCONF *ifconf);
#ifdef __cplusplus
}
#endif
#endif