Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mpoa_caches.h
Go to the documentation of this file.
1 #ifndef MPOA_CACHES_H
2 #define MPOA_CACHES_H
3 
4 #include <linux/netdevice.h>
5 #include <linux/types.h>
6 #include <linux/atm.h>
7 #include <linux/atmdev.h>
8 #include <linux/atmmpc.h>
9 
10 struct mpoa_client;
11 
12 void atm_mpoa_init_cache(struct mpoa_client *mpc);
13 
14 typedef struct in_cache_entry {
17  struct timeval tv;
25  struct atm_vcc *shortcut;
30 
31 struct in_cache_ops{
32  in_cache_entry *(*add_entry)(__be32 dst_ip,
33  struct mpoa_client *client);
34  in_cache_entry *(*get)(__be32 dst_ip, struct mpoa_client *client);
35  in_cache_entry *(*get_with_mask)(__be32 dst_ip,
36  struct mpoa_client *client,
37  __be32 mask);
38  in_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc,
39  struct mpoa_client *client);
42  struct mpoa_client *client );
44  struct mpoa_client *client);
48  void (*destroy_cache)(struct mpoa_client *mpc);
49 };
50 
51 typedef struct eg_cache_entry{
54  struct timeval tv;
56  struct atm_vcc *shortcut;
59  __be32 latest_ip_addr; /* The src IP address of the last packet */
63 
64 struct eg_cache_ops{
65  eg_cache_entry *(*add_entry)(struct k_message *msg, struct mpoa_client *client);
66  eg_cache_entry *(*get_by_cache_id)(__be32 cache_id, struct mpoa_client *client);
67  eg_cache_entry *(*get_by_tag)(__be32 cache_id, struct mpoa_client *client);
68  eg_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, struct mpoa_client *client);
69  eg_cache_entry *(*get_by_src_ip)(__be32 ipaddr, struct mpoa_client *client);
72  void (*update)(eg_cache_entry *entry, uint16_t holding_time);
74  void (*destroy_cache)(struct mpoa_client *mpc);
75 };
76 
77 
78 /* Ingress cache entry states */
79 
80 #define INGRESS_REFRESHING 3
81 #define INGRESS_RESOLVED 2
82 #define INGRESS_RESOLVING 1
83 #define INGRESS_INVALID 0
84 
85 /* VCC states */
86 
87 #define OPEN 1
88 #define CLOSED 0
89 
90 /* Egress cache entry states */
91 
92 #define EGRESS_RESOLVED 2
93 #define EGRESS_PURGE 1
94 #define EGRESS_INVALID 0
95 
96 #endif