network.h
/*
* libsysactivity
* http://sourceforge.net/projects/libsysactivity/
* Copyright (c) 2009, 2010 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SA_NET_H_
#define SA_NET_H_
struct sa_net_interface {
#ifdef SA_NET_INTERFACE_NAME
char name[SA_NET_INTERFACE_NAME];
#endif
#ifdef SA_NET_INTERFACE_RECEIVED_BYTES
uint64_t received_bytes;
#endif
#ifdef SA_NET_INTERFACE_RECEIVED_PACKETS
uint64_t received_packets;
#endif
#ifdef SA_NET_INTERFACE_RECEIVED_ERRORS
uint64_t received_errors;
#endif
#ifdef SA_NET_INTERFACE_RECEIVED_DROP
uint64_t received_drop;
#endif
#ifdef SA_NET_INTERFACE_RECEIVED_FIFO
uint64_t received_fifo;
#endif
#ifdef SA_NET_INTERFACE_RECEIVED_COMPRESSED
uint64_t received_compressed;
#endif
#ifdef SA_NET_INTERFACE_RECEIVED_MULTICAST
uint64_t received_multicast;
#endif
#ifdef SA_NET_INTERFACE_SENT_BYTES
uint64_t sent_bytes;
#endif
#ifdef SA_NET_INTERFACE_SENT_PACKETS
uint64_t sent_packets;
#endif
#ifdef SA_NET_INTERFACE_SENT_ERRORS
uint64_t sent_errors;
#endif
#ifdef SA_NET_INTERFACE_SENT_DROP
uint64_t sent_drop;
#endif
#ifdef SA_NET_INTERFACE_SENT_FIFO
uint64_t sent_fifo;
#endif
#ifdef SA_NET_INTERFACE_SENT_COMPRESSED
uint64_t sent_compressed;
#endif
#ifdef SA_NET_INTERFACE_SENT_MULTICAST
uint64_t sent_multicast;
#endif
};
#ifdef SA_OPEN_NET
int sa_open_net(void) SA_EXPORT;
#endif
#ifdef SA_CLOSE_NET
int sa_close_net(void) SA_EXPORT;
#endif
int sa_count_net_interfaces(uint16_t* number) SA_EXPORT SA_NONNULL;
int sa_reset_net_interfaces() SA_EXPORT;
int sa_get_net_interfaces_ids(char* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
int sa_get_net_interface(char* name, struct sa_net_interface* dst) SA_EXPORT SA_NONNULL;
int sa_get_net_interfaces(struct sa_net_interface* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
#endif /* SA_NET_H_ */
sa_net_interface::received_packets
uint64_t received_packets
Total number of received packets.
Definition: network.h:39
sa_get_net_interface
int sa_get_net_interface(char *name, struct sa_net_interface *dst) SA_EXPORT SA_NONNULL
sa_net_interface::sent_errors
uint64_t sent_errors
Amount of sent errors.
Definition: network.h:63
sa_net_interface::received_fifo
uint64_t received_fifo
The number of fifo buffer errors received.
Definition: network.h:48
sa_net_interface::received_drop
uint64_t received_drop
Total number of received packets that had been dropped.
Definition: network.h:45
sa_net_interface::sent_bytes
uint64_t sent_bytes
Total number of transmitted bytes.
Definition: network.h:57
sa_net_interface::sent_compressed
uint64_t sent_compressed
The number of compressed packets transmitted by the device driver.
Definition: network.h:72
sa_close_net
int sa_close_net(void) SA_EXPORT
sa_net_interface::received_bytes
uint64_t received_bytes
Total number of received bytes.
Definition: network.h:36
sa_open_net
int sa_open_net(void) SA_EXPORT
sa_net_interface
Definition: network.h:31
sa_net_interface::sent_multicast
uint64_t sent_multicast
Number of packets sent by link-layer multicast.
Definition: network.h:75
sa_get_net_interfaces_ids
int sa_get_net_interfaces_ids(char *dst, uint16_t dst_size, uint16_t *written) SA_EXPORT SA_NONNULL
sa_net_interface::received_multicast
uint64_t received_multicast
Number of packets received which were sent by link-layer multicast.
Definition: network.h:54
sa_net_interface::received_errors
uint64_t received_errors
Amount of received errors.
Definition: network.h:42
sa_count_net_interfaces
int sa_count_net_interfaces(uint16_t *number) SA_EXPORT SA_NONNULL
sa_get_net_interfaces
int sa_get_net_interfaces(struct sa_net_interface *dst, uint16_t dst_size, uint16_t *written) SA_EXPORT SA_NONNULL
sa_net_interface::received_compressed
uint64_t received_compressed
The number of compressed packets received by the device driver.
Definition: network.h:51
sa_net_interface::sent_drop
uint64_t sent_drop
Total number of sent packets that had been dropped.
Definition: network.h:66
sa_net_interface::sent_packets
uint64_t sent_packets
Total number of sent packets.
Definition: network.h:60
sa_net_interface::name
char name[SA_NET_INTERFACE_NAME]
Interface's name. It's used as the unique identifier of the interface.
Definition: network.h:33
sa_net_interface::sent_fifo
uint64_t sent_fifo
The number of fifo buffer errors sent.
Definition: network.h:69
sa_reset_net_interfaces
int sa_reset_net_interfaces() SA_EXPORT