00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SA_NETWORK
00022 #warning You should not include this file directly from your program.
00023 #endif
00024
00029 #ifndef SA_COMMON_NETWORK_H_
00030 #define SA_COMMON_NETWORK_H_
00031
00035 SA_EXPORT struct sa_network_interface {
00036 #ifdef SA_NETWORK_INTERFACE_NAME
00037 char name[SA_NETWORK_INTERFACE_NAME];
00038 #endif
00039 #ifdef SA_NETWORK_INTERFACE_RECEIVED_BYTES
00040 uint64_t received_bytes;
00041 #endif
00042 #ifdef SA_NETWORK_INTERFACE_RECEIVED_PACKETS
00043 uint64_t received_packets;
00044 #endif
00045 #ifdef SA_NETWORK_INTERFACE_RECEIVED_ERRORS
00046 uint64_t received_errors;
00047 #endif
00048 #ifdef SA_NETWORK_INTERFACE_RECEIVED_DROP
00049 uint64_t received_drop;
00050 #endif
00051 #ifdef SA_NETWORK_INTERFACE_RECEIVED_FIFO
00052 uint64_t received_fifo;
00053 #endif
00054 #ifdef SA_NETWORK_INTERFACE_RECEIVED_COMPRESSED
00055 uint64_t received_compressed;
00056 #endif
00057 #ifdef SA_NETWORK_INTERFACE_RECEIVED_MULTICAST
00058 uint64_t received_multicast;
00059 #endif
00060 #ifdef SA_NETWORK_INTERFACE_SENT_BYTES
00061 uint64_t sent_bytes;
00062 #endif
00063 #ifdef SA_NETWORK_INTERFACE_SENT_PACKETS
00064 uint64_t sent_packets;
00065 #endif
00066 #ifdef SA_NETWORK_INTERFACE_SENT_ERRORS
00067 uint64_t sent_errors;
00068 #endif
00069 #ifdef SA_NETWORK_INTERFACE_SENT_DROP
00070 uint64_t sent_drop;
00071 #endif
00072 #ifdef SA_NETWORK_INTERFACE_SENT_FIFO
00073 uint64_t sent_fifo;
00074 #endif
00075 #ifdef SA_NETWORK_INTERFACE_SENT_COMPRESSED
00076 uint64_t sent_compressed;
00077 #endif
00078 #ifdef SA_NETWORK_INTERFACE_SENT_MULTICAST
00079 uint64_t sent_multicast;
00080 #endif
00081 };
00082
00083 #ifdef SA_OPEN_NETWORK
00084
00089 SA_EXPORT int sa_open_network(void);
00090 #endif
00091
00092 #ifdef SA_CLOSE_NETWORK
00093
00098 SA_EXPORT int sa_close_network(void);
00099 #endif
00100
00106 SA_EXPORT int sa_count_network_interfaces(uint16_t* number);
00107
00114 SA_EXPORT int sa_get_network_interface(char* name, struct sa_network_interface* dst);
00115
00123 SA_EXPORT int sa_get_network_interfaces(struct sa_network_interface* dst, uint16_t dst_size, uint16_t* written);
00124
00126 #endif