patch-1.3.51 linux/include/linux/net_alias.h
Next file: linux/include/net/ip_alias.h
Previous file: linux/include/linux/fs.h
Back to the patch index
Back to the overall index
- Lines: 131
- Date:
Wed Dec 27 07:46:29 1995
- Orig file:
v1.3.50/linux/include/linux/net_alias.h
- Orig date:
Wed Dec 13 09:02:47 1995
diff -u --recursive --new-file v1.3.50/linux/include/linux/net_alias.h linux/include/linux/net_alias.h
@@ -1,12 +1,25 @@
+/*
+ * NET_ALIAS network device aliasing definitions.
+ *
+ *
+ * Version: @(#)net_alias.h 0.43 12/20/95
+ *
+ * Author: Juan Jose Ciarlante, <jjciarla@raiz.uncu.edu.ar>
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
#ifndef _NET_ALIAS_H
#define _NET_ALIAS_H
#include <linux/types.h>
#include <linux/if.h>
#include <linux/netdevice.h>
-#include <linux/inet.h>
-#include <linux/in.h> /* for default IP behavior */
-
/*
* max. alias slot number allowed
@@ -32,7 +45,7 @@
unsigned slot; /* slot number */
void *data; /* private data */
struct device *main_dev; /* pointer to main device */
- struct net_alias_type *nat; /* alias type bound */
+ struct net_alias_type *nat; /* alias type object bound */
struct net_alias *next; /* next alias (hashed linked list) */
};
@@ -61,15 +74,17 @@
int n_attach; /* number of aliases attached */
char name[16]; /* af_name */
__u32 (*get_addr32) /* get __u32 addr 'representation'*/
- (struct sockaddr*);
- int (*addr_chk) /* address checking func: */
- (struct device *, struct sockaddr *);
+ (struct net_alias_type *this, struct sockaddr*);
+ int (*dev_addr_chk) /* address checking func: */
+ (struct net_alias_type *this, struct device *, struct sockaddr *);
+ struct device * (*dev_select) /* closest alias selector*/
+ (struct net_alias_type *this, struct device *, struct sockaddr *sa);
int (*alias_init_1) /* called after alias creation: */
- (struct net_alias *alias, struct sockaddr *sa);
+ (struct net_alias_type *this,struct net_alias *alias, struct sockaddr *sa);
int (*alias_done_1) /* called before alias deletion */
- (struct net_alias *alias);
+ (struct net_alias_type *this, struct net_alias *alias);
int (*alias_print_1)
- (char *buf, int len, struct net_alias *alias);
+ (struct net_alias_type *this, struct net_alias *alias, char *buf, int len);
struct net_alias_type *next; /* link */
};
@@ -81,7 +96,7 @@
static __inline__ int
net_alias_is(struct device *dev)
{
- return (dev->my_alias != 0);
+ return (dev->my_alias != NULL);
}
@@ -92,14 +107,14 @@
static __inline__ int
net_alias_has(struct device *dev)
{
- return (dev->alias_info != 0);
+ return (dev->alias_info != NULL);
}
extern void net_alias_init(void);
extern struct device * net_alias_dev_get(char *dev_name, int aliasing_ok, int *err, struct sockaddr *sa, void *data);
-extern int net_alias_rehash(struct net_alias *alias, struct sockaddr *sa);
+extern int net_alias_dev_rehash(struct device *dev, struct sockaddr *sa);
extern int net_alias_getinfo(char *buf, char **, off_t , int , int );
extern int net_alias_types_getinfo(char *buf, char **, off_t , int , int );
@@ -107,8 +122,11 @@
extern int register_net_alias_type(struct net_alias_type *nat, int type);
extern int unregister_net_alias_type(struct net_alias_type *nat);
-extern struct device * net_alias_chk(struct device *dev, struct sockaddr *sa, int flags_1, int flags_0);
-extern struct device * net_alias_chk32(struct device *dev, int family, __u32 addr32, int flags_1, int flags_0);
+extern struct device * net_alias_dev_chk(struct device *main_dev, struct sockaddr *sa, int flags_on, int flags_off);
+extern struct device * net_alias_dev_chk32(struct device *main_dev, int family, __u32 addr32, int flags_on, int flags_off);
+
+extern struct device * net_alias_dev_rcv_sel(struct device *main_dev, struct sockaddr *sa_src, struct sockaddr *sa_dst);
+extern struct device * net_alias_dev_rcv_sel32(struct device *main_dev, int family, __u32 src, __u32 dst);
/*
@@ -149,28 +167,6 @@
}
pdev->next = nextdev;
return nextdev;
-}
-
-
-/*
- * addr_chk wrapper: check given generic address with (UP) aliases
- */
-
-static __inline__ struct device *
-net_alias_addr_chk(struct device *dev, struct sockaddr *sa)
-{
- return net_alias_chk(dev, sa, IFF_UP, 0);
-}
-
-
-/*
- * addr_chk32 wrapper: check given u32 address with (UP) aliases
- */
-
-static __inline__ struct device *
-net_alias_addr_chk32(struct device *dev, int family, __u32 addr32)
-{
- return net_alias_chk32(dev, family, addr32, IFF_UP, 0);
}
#endif /* _NET_ALIAS_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this