mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-04 21:09:19 +08:00
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
|
#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 ACL_MS_WINDOWS
|
|||
|
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
|