]> git.ozlabs.org Git - ppp.git/blob - pppd/multilink.h
Makefile.am: Add explicit openssl directory to pppd include path
[ppp.git] / pppd / multilink.h
1 /*
2  * multilink.h - support routines for multilink.
3  *
4  * Copyright (c) 2000-2002 Paul Mackerras. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  *
13  * 2. The name(s) of the authors of this software must not be used to
14  *    endorse or promote products derived from this software without
15  *    prior written permission.
16  *
17  * 3. Redistributions of any form whatsoever must retain the following
18  *    acknowledgment:
19  *    "This product includes software developed by Paul Mackerras
20  *     <paulus@samba.org>".
21  *
22  * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
23  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24  * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
25  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
28  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29  */
30
31 #ifndef PPP_MULTILINK_H
32 #define PPP_MULTILINK_H
33
34 #include "pppdconf.h"
35
36 /*
37  * values for epdisc.class
38  */
39 #define EPD_NULL        0       /* null discriminator, no data */
40 #define EPD_LOCAL       1
41 #define EPD_IP          2
42 #define EPD_MAC         3
43 #define EPD_MAGIC       4
44 #define EPD_PHONENUM    5
45
46 struct epdisc;
47
48 #ifdef PPP_WITH_MULTILINK
49
50 /*
51  * Check multilink-related options
52  */
53 void mp_check_options(void);
54
55 /*
56  * Join our link to an appropriate bundle
57  */
58 int mp_join_bundle(void);
59
60 /*
61  * Disconnected our link from the bundle
62  */
63 void mp_exit_bundle(void);
64
65 /*
66  * Multipoint bundle terminated
67  */
68 void mp_bundle_terminated(void);
69
70 /*
71  * Acting as a multilink master
72  */
73 bool mp_master();
74
75 /*
76  * Was multilink negotiated
77  */
78 bool mp_on();
79
80 /*
81  * Convert an endpoint discriminator to a string
82  */
83 char *epdisc_to_str(struct epdisc *);
84
85 /*
86  * Convert a string to an endpoint discriminator
87  */
88 int str_to_epdisc(struct epdisc *, char *);
89
90 /*
91  * Hook for plugin to hear when an interface joins a multilink bundle
92  */
93 typedef void (multilink_join_hook_fn)(void);
94 extern multilink_join_hook_fn *multilink_join_hook;
95
96 #else
97
98 #define mp_check_options(x)     ((void)0)
99 #define mp_join_bundle(x)       ((void)0)
100 #define mp_exit_bundle(x)       ((void)0)
101 #define mp_bundle_terminated(x) ((void)0)
102
103 static inline bool mp_on() {
104     return false;
105 }
106
107 static inline bool mp_master() {
108     return false;
109 }
110
111 #endif // PPP_WITH_MULTILINK
112 #endif // PPP_MULTILINK_H