libsysactivity 0.6.2
src/common/network.h
00001 /*
00002  * libsysactivity
00003  * http://sourceforge.net/projects/libsysactivity/
00004  * Copyright (c) 2009, 2010 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00025 #ifndef SA_NET_H_
00026 #define SA_NET_H_
00027 
00031 SA_EXPORT struct sa_net_interface {
00032 #ifdef SA_NET_INTERFACE_NAME
00033         char name[SA_NET_INTERFACE_NAME]; 
00034 #endif
00035 #ifdef SA_NET_INTERFACE_RECEIVED_BYTES
00036         uint64_t received_bytes; 
00037 #endif
00038 #ifdef SA_NET_INTERFACE_RECEIVED_PACKETS
00039         uint64_t received_packets; 
00040 #endif
00041 #ifdef SA_NET_INTERFACE_RECEIVED_ERRORS
00042         uint64_t received_errors; 
00043 #endif
00044 #ifdef SA_NET_INTERFACE_RECEIVED_DROP
00045         uint64_t received_drop; 
00046 #endif
00047 #ifdef SA_NET_INTERFACE_RECEIVED_FIFO
00048         uint64_t received_fifo; 
00049 #endif
00050 #ifdef SA_NET_INTERFACE_RECEIVED_COMPRESSED
00051         uint64_t received_compressed; 
00052 #endif
00053 #ifdef SA_NET_INTERFACE_RECEIVED_MULTICAST
00054         uint64_t received_multicast; 
00055 #endif
00056 #ifdef SA_NET_INTERFACE_SENT_BYTES
00057         uint64_t sent_bytes; 
00058 #endif
00059 #ifdef SA_NET_INTERFACE_SENT_PACKETS
00060         uint64_t sent_packets; 
00061 #endif
00062 #ifdef SA_NET_INTERFACE_SENT_ERRORS
00063         uint64_t sent_errors; 
00064 #endif
00065 #ifdef SA_NET_INTERFACE_SENT_DROP
00066         uint64_t sent_drop; 
00067 #endif
00068 #ifdef SA_NET_INTERFACE_SENT_FIFO
00069         uint64_t sent_fifo; 
00070 #endif
00071 #ifdef SA_NET_INTERFACE_SENT_COMPRESSED
00072         uint64_t sent_compressed; 
00073 #endif
00074 #ifdef SA_NET_INTERFACE_SENT_MULTICAST
00075         uint64_t sent_multicast; 
00076 #endif
00077 };
00078 
00079 #ifdef SA_OPEN_NET
00080 
00086 int sa_open_net(void) SA_EXPORT;
00087 #endif
00088 
00089 #ifdef SA_CLOSE_NET
00090 
00096 int sa_close_net(void) SA_EXPORT;
00097 #endif
00098 
00106 int sa_count_net_interfaces(uint16_t* number) SA_EXPORT SA_NONNULL;
00107 
00113 int sa_reset_net_interfaces() SA_EXPORT;
00114 
00124 int sa_get_net_interfaces_ids(char* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
00125 
00134 int sa_get_net_interface(char* name, struct sa_net_interface* dst) SA_EXPORT SA_NONNULL;
00135 
00145 int sa_get_net_interfaces(struct sa_net_interface* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
00146 
00148 #endif /* SA_NET_H_ */
 All Data Structures Variables