]>
Commit | Line | Data |
---|---|---|
e9e28be3 | 1 | /* |
e0edde6f | 2 | * Copyright (c) 2009 Nicira, Inc. |
e9e28be3 BP |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at: | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
0a811051 EJ |
17 | #ifndef NETLINK_NOTIFIER_H |
18 | #define NETLINK_NOTIFIER_H 1 | |
e9e28be3 | 19 | |
559843ed BP |
20 | /* These functions are Linux specific, so they should be used directly only by |
21 | * Linux-specific code. */ | |
e9e28be3 | 22 | |
b19bab5b | 23 | #include "openvswitch/list.h" |
e9e28be3 | 24 | |
0a811051 | 25 | struct nln; |
2ee6545f EJ |
26 | struct nln_notifier; |
27 | ||
21d6e22e EJ |
28 | struct nlattr; |
29 | struct ofpbuf; | |
30 | ||
0a811051 EJ |
31 | /* Function called to report netlink notifications. 'change' describes the |
32 | * specific change filled out by an nln_parse_func. It may be null if the | |
33 | * buffer of change information overflowed, in which case the function must | |
21d6e22e | 34 | * assume that everything may have changed. 'aux' is as specified in |
0a811051 EJ |
35 | * nln_notifier_register(). */ |
36 | typedef void nln_notify_func(const void *change, void *aux); | |
e9e28be3 | 37 | |
0a811051 | 38 | /* Function called to parse incoming nln notifications. The 'buf' message |
77ee67e4 JR |
39 | * should be parsed into 'change' as specified in nln_create(). |
40 | * Returns the multicast_group the change belongs to, or 0 for a parse error. | |
41 | */ | |
42 | typedef int nln_parse_func(struct ofpbuf *buf, void *change); | |
e9e28be3 | 43 | |
77ee67e4 | 44 | struct nln *nln_create(int protocol, nln_parse_func *, void *change); |
0a811051 | 45 | void nln_destroy(struct nln *); |
77ee67e4 JR |
46 | struct nln_notifier *nln_notifier_create(struct nln *, int multicast_group, |
47 | nln_notify_func *, void *aux); | |
2ee6545f | 48 | void nln_notifier_destroy(struct nln_notifier *); |
18a23781 EJ |
49 | void nln_run(struct nln *); |
50 | void nln_wait(struct nln *); | |
e8e1a409 | 51 | void nln_report(const struct nln *nln, void *change, int group); |
0a811051 | 52 | #endif /* netlink-notifier.h */ |