2 * multilink.h - support routines for multilink.
4 * Copyright (c) 2000-2002 Paul Mackerras. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
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.
17 * 3. Redistributions of any form whatsoever must retain the following
19 * "This product includes software developed by Paul Mackerras
20 * <paulus@ozlabs.org>".
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.
31 #ifndef PPP_MULTILINK_H
32 #define PPP_MULTILINK_H
41 * values for epdisc.class
43 #define EPD_NULL 0 /* null discriminator, no data */
48 #define EPD_PHONENUM 5
52 #ifdef PPP_WITH_MULTILINK
55 * Check multilink-related options
57 void mp_check_options(void);
60 * Join our link to an appropriate bundle
62 int mp_join_bundle(void);
65 * Disconnected our link from the bundle
67 void mp_exit_bundle(void);
70 * Multipoint bundle terminated
72 void mp_bundle_terminated(void);
75 * Acting as a multilink master
80 * Was multilink negotiated
85 * Convert an endpoint discriminator to a string
87 char *epdisc_to_str(struct epdisc *);
90 * Convert a string to an endpoint discriminator
92 int str_to_epdisc(struct epdisc *, char *);
95 * Hook for plugin to hear when an interface joins a multilink bundle
97 typedef void (multilink_join_hook_fn)(void);
98 extern multilink_join_hook_fn *multilink_join_hook;
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)
107 static inline bool mp_on() {
111 static inline bool mp_master() {
115 #endif // PPP_WITH_MULTILINK
121 #endif // PPP_MULTILINK_H