]> git.ozlabs.org Git - ppp.git/blob - pppd/multilink.h
CI: Updated the 'checkout' actions that were using Node.js 16 to Node.js 20. (#489)
[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 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /*
41  * values for epdisc.class
42  */
43 #define EPD_NULL        0       /* null discriminator, no data */
44 #define EPD_LOCAL       1
45 #define EPD_IP          2
46 #define EPD_MAC         3
47 #define EPD_MAGIC       4
48 #define EPD_PHONENUM    5
49
50 struct epdisc;
51
52 #ifdef PPP_WITH_MULTILINK
53
54 /*
55  * Check multilink-related options
56  */
57 void mp_check_options(void);
58
59 /*
60  * Join our link to an appropriate bundle
61  */
62 int mp_join_bundle(void);
63
64 /*
65  * Disconnected our link from the bundle
66  */
67 void mp_exit_bundle(void);
68
69 /*
70  * Multipoint bundle terminated
71  */
72 void mp_bundle_terminated(void);
73
74 /*
75  * Acting as a multilink master
76  */
77 bool mp_master();
78
79 /*
80  * Was multilink negotiated
81  */
82 bool mp_on();
83
84 /*
85  * Convert an endpoint discriminator to a string
86  */
87 char *epdisc_to_str(struct epdisc *);
88
89 /*
90  * Convert a string to an endpoint discriminator
91  */
92 int str_to_epdisc(struct epdisc *, char *);
93
94 /*
95  * Hook for plugin to hear when an interface joins a multilink bundle
96  */
97 typedef void (multilink_join_hook_fn)(void);
98 extern multilink_join_hook_fn *multilink_join_hook;
99
100 #else
101
102 #define mp_check_options(x)     ((void)0)
103 #define mp_join_bundle(x)       ((void)0)
104 #define mp_exit_bundle(x)       ((void)0)
105 #define mp_bundle_terminated(x) ((void)0)
106
107 static inline bool mp_on() {
108     return false;
109 }
110
111 static inline bool mp_master() {
112     return false;
113 }
114
115 #endif // PPP_WITH_MULTILINK
116
117 #ifdef __cplusplus
118 }
119 #endif
120
121 #endif // PPP_MULTILINK_H