BFD: Add check_tnl_key feature to BFD code.
[sliver-openvswitch.git] / lib / bfd.h
1 /* Copyright (c) 2012 Nicira, Inc.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.  */
14
15 #ifndef BFD_H
16 #define BFD_H 1
17
18 #define BFD_PACKET_LEN 24
19 #define BFD_DEST_PORT 3784
20
21 #include <stdbool.h>
22 #include <inttypes.h>
23
24 struct bfd;
25 struct flow;
26 struct flow_wildcards;
27 struct ofpbuf;
28 struct smap;
29
30 void bfd_wait(const struct bfd *);
31 void bfd_run(struct bfd *);
32
33 bool bfd_should_send_packet(const struct bfd *);
34 void bfd_put_packet(struct bfd *bfd, struct ofpbuf *packet,
35                     uint8_t eth_src[6]);
36
37 bool bfd_should_process_flow(const struct bfd *, const struct flow *,
38                              struct flow_wildcards *);
39 void bfd_process_packet(struct bfd *, const struct flow *,
40                         const struct ofpbuf *);
41
42 struct bfd *bfd_configure(struct bfd *, const char *name,
43                           const struct smap *smap);
44 struct bfd *bfd_ref(const struct bfd *);
45 void bfd_unref(struct bfd *);
46
47 bool bfd_forwarding(const struct bfd *);
48 void bfd_get_status(const struct bfd *, struct smap *);
49
50 #endif /* bfd.h */