Blame view
include/linux/connector.h
3.42 KB
7672d0b54 [NET]: Add netlin... |
1 2 3 |
/* * connector.h * |
a80187663 MAINTAINERS: Evge... |
4 |
* 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net> |
7672d0b54 [NET]: Add netlin... |
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
* All rights reserved. * * 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. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __CONNECTOR_H #define __CONNECTOR_H |
00bfddaf7 include of <linux... |
24 |
#include <linux/types.h> |
7672d0b54 [NET]: Add netlin... |
25 |
|
9f46080c4 [PATCH] Process E... |
26 27 28 29 30 |
/* * Process Events connector unique ids -- used for message routing */ #define CN_IDX_PROC 0x1 #define CN_VAL_PROC 0x1 |
a2653ebab [CIFS] Reserve up... |
31 32 |
#define CN_IDX_CIFS 0x2 #define CN_VAL_CIFS 0x1 |
b6043fcab [PATCH] w1: Move ... |
33 34 |
#define CN_W1_IDX 0x3 /* w1 communication */ #define CN_W1_VAL 0x1 |
cc54f46e3 uvesafb: add conn... |
35 36 |
#define CN_IDX_V86D 0x4 #define CN_VAL_V86D_UVESAFB 0x1 |
2c203003f connector: add a ... |
37 |
#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ |
ce0d9d725 Staging: dst: cor... |
38 39 |
#define CN_DST_IDX 0x6 #define CN_DST_VAL 0x1 |
f5db4af46 dm raid1: add use... |
40 41 |
#define CN_IDX_DM 0x7 /* Device Mapper */ #define CN_VAL_DM_USERSPACE_LOG 0x1 |
35a8a3fdc drbd: moved CN_ID... |
42 43 |
#define CN_IDX_DRBD 0x8 #define CN_VAL_DRBD 0x1 |
a0a5b6764 Connector: Add an... |
44 |
#define CN_KVP_IDX 0x9 /* HyperV KVP */ |
9f46080c4 [PATCH] Process E... |
45 |
|
ea2c00095 Connector: Set th... |
46 |
#define CN_NETLINK_USERS 10 /* Highest index + 1 */ |
7672d0b54 [NET]: Add netlin... |
47 48 49 50 |
/* * Maximum connector's message size. */ |
3d62a44f7 connector: change... |
51 |
#define CONNECTOR_MAX_MSG_SIZE 16384 |
7672d0b54 [NET]: Add netlin... |
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
/* * idx and val are unique identifiers which * are used for message routing and * must be registered in connector.h for in-kernel usage. */ struct cb_id { __u32 idx; __u32 val; }; struct cn_msg { struct cb_id id; __u32 seq; __u32 ack; __u16 len; /* Length of the following data */ __u16 flags; __u8 data[0]; }; |
7672d0b54 [NET]: Add netlin... |
74 |
#ifdef __KERNEL__ |
60063497a atomic: use <linu... |
75 |
#include <linux/atomic.h> |
7672d0b54 [NET]: Add netlin... |
76 77 78 79 80 81 82 83 84 85 86 |
#include <linux/list.h> #include <linux/workqueue.h> #include <net/sock.h> #define CN_CBQ_NAMELEN 32 struct cn_queue_dev { atomic_t refcnt; unsigned char name[CN_CBQ_NAMELEN]; |
7672d0b54 [NET]: Add netlin... |
87 88 |
struct list_head queue_list; spinlock_t queue_lock; |
7672d0b54 [NET]: Add netlin... |
89 90 |
struct sock *nls; }; |
acd042bb2 [CONNECTOR]: asyn... |
91 |
struct cn_callback_id { |
7672d0b54 [NET]: Add netlin... |
92 |
unsigned char name[CN_CBQ_NAMELEN]; |
7672d0b54 [NET]: Add netlin... |
93 |
struct cb_id id; |
acd042bb2 [CONNECTOR]: asyn... |
94 |
}; |
7672d0b54 [NET]: Add netlin... |
95 96 |
struct cn_callback_entry { struct list_head callback_entry; |
04f482faf connector: conver... |
97 |
atomic_t refcnt; |
7672d0b54 [NET]: Add netlin... |
98 |
struct cn_queue_dev *pdev; |
acd042bb2 [CONNECTOR]: asyn... |
99 |
struct cn_callback_id id; |
04f482faf connector: conver... |
100 |
void (*callback) (struct cn_msg *, struct netlink_skb_parms *); |
7672d0b54 [NET]: Add netlin... |
101 |
|
6e32814bc [CONNECTOR]: Clea... |
102 |
u32 seq, group; |
7672d0b54 [NET]: Add netlin... |
103 |
}; |
7672d0b54 [NET]: Add netlin... |
104 105 106 107 108 |
struct cn_dev { struct cb_id id; u32 seq, groups; struct sock *nls; |
cd40b7d39 [NET]: make netli... |
109 |
void (*input) (struct sk_buff *skb); |
7672d0b54 [NET]: Add netlin... |
110 111 112 |
struct cn_queue_dev *cbdev; }; |
008536e84 connector: Conver... |
113 114 |
int cn_add_callback(struct cb_id *id, const char *name, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); |
7672d0b54 [NET]: Add netlin... |
115 |
void cn_del_callback(struct cb_id *); |
dd0fc66fb [PATCH] gfp flags... |
116 |
int cn_netlink_send(struct cn_msg *, u32, gfp_t); |
7672d0b54 [NET]: Add netlin... |
117 |
|
008536e84 connector: Conver... |
118 119 120 |
int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); |
7672d0b54 [NET]: Add netlin... |
121 |
void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
04f482faf connector: conver... |
122 |
void cn_queue_release_callback(struct cn_callback_entry *); |
7672d0b54 [NET]: Add netlin... |
123 |
|
008536e84 connector: Conver... |
124 |
struct cn_queue_dev *cn_queue_alloc_dev(const char *name, struct sock *); |
7672d0b54 [NET]: Add netlin... |
125 126 127 |
void cn_queue_free_dev(struct cn_queue_dev *dev); int cn_cb_equal(struct cb_id *, struct cb_id *); |
7672d0b54 [NET]: Add netlin... |
128 129 |
#endif /* __KERNEL__ */ #endif /* __CONNECTOR_H */ |