diff options
author | shemminger <shemminger> | 2004-05-21 17:41:48 +0000 |
---|---|---|
committer | shemminger <shemminger> | 2004-05-21 17:41:48 +0000 |
commit | 328f4711bbc369dcccf8f8cfba2adf5dd0f74479 (patch) | |
tree | 8dd07660534f32407d249d0259e2e8f3a62f2ae5 /libbridge/libbridge_private.h | |
parent | 064717a4d7e47b47ba42e658abfd36acaa4a65d6 (diff) | |
download | android_external_brctl-328f4711bbc369dcccf8f8cfba2adf5dd0f74479.tar.gz android_external_brctl-328f4711bbc369dcccf8f8cfba2adf5dd0f74479.tar.bz2 android_external_brctl-328f4711bbc369dcccf8f8cfba2adf5dd0f74479.zip |
New version of command and library that use sysfs.
Update make system to build with or without sysfs.
Diffstat (limited to 'libbridge/libbridge_private.h')
-rw-r--r-- | libbridge/libbridge_private.h | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/libbridge/libbridge_private.h b/libbridge/libbridge_private.h index 98ded65..57d0233 100644 --- a/libbridge/libbridge_private.h +++ b/libbridge/libbridge_private.h @@ -19,16 +19,56 @@ #ifndef _LIBBRIDGE_PRIVATE_H #define _LIBBRIDGE_PRIVATE_H +#include "config.h" + +#include <linux/sockios.h> +#include <sys/time.h> +#include <sys/ioctl.h> +#include <linux/if_bridge.h> #include <asm/param.h> +#ifdef HAVE_LIBSYSFS +#include <sysfs/libsysfs.h> + +#ifndef SYSFS_BRIDGE_PORT_ATTR +#error Using wrong kernel headers if_bridge.h is out of date. +#endif + +#ifndef SIOCBRADDBR +#error Using wrong kernel headers sockios.h is out of date. +#endif + +#else +struct sysfs_class { const char *name; }; + +static inline struct sysfs_class *sysfs_open_class(const char *name) +{ + return NULL; +} + +static inline void sysfs_close_class(struct sysfs_class *class) +{ +} +#endif + extern int br_socket_fd; +extern struct sysfs_class *br_class_net; + +static inline unsigned long __tv_to_jiffies(const struct timeval *tv) +{ + unsigned long long jif; + + jif = 1000000ULL * tv->tv_sec + tv->tv_usec; -void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies); -unsigned long __tv_to_jiffies(struct timeval *tv); + return (HZ*jif)/1000000; +} -int br_get_br(unsigned long arg0, unsigned long arg1, unsigned long arg2); -int br_set_br(unsigned long arg0, unsigned long arg1, unsigned long arg2); -int br_device_ioctl(const struct bridge *br, unsigned long arg0, - unsigned long arg1, unsigned long arg2, unsigned long arg3); +static inline void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies) +{ + unsigned long long tvusec; + tvusec = (1000000ULL*jiffies)/HZ; + tv->tv_sec = tvusec/1000000; + tv->tv_usec = tvusec - 1000000 * tv->tv_sec; +} #endif |