Initial import from FreeBSD RELENG_4:
[dragonfly.git] / lib / libatm / libatm.h
1 /*
2  *
3  * ===================================
4  * HARP  |  Host ATM Research Platform
5  * ===================================
6  *
7  *
8  * This Host ATM Research Platform ("HARP") file (the "Software") is
9  * made available by Network Computing Services, Inc. ("NetworkCS")
10  * "AS IS".  NetworkCS does not provide maintenance, improvements or
11  * support of any kind.
12  *
13  * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
14  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
15  * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
16  * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
17  * In no event shall NetworkCS be responsible for any damages, including
18  * but not limited to consequential damages, arising from or relating to
19  * any use of the Software or related support.
20  *
21  * Copyright 1994-1998 Network Computing Services, Inc.
22  *
23  * Copies of this Software may be made, however, the above copyright
24  * notice must be reproduced on all copies.
25  *
26  *      @(#) $FreeBSD: src/lib/libatm/libatm.h,v 1.3 1999/08/27 23:58:05 peter Exp $
27  *
28  */
29
30 /*
31  * User Space Library Functions
32  * ----------------------------
33  *
34  * Library functions
35  *
36  */
37
38 #ifndef _HARP_LIBHARP_H
39 #define _HARP_LIBHARP_H
40
41 /*
42  * Start a HARP user-space timer
43  *
44  *      tp      pointer to timer control block
45  *      time    number of seconds for timer to run
46  *      fp      pointer to function to call at expiration
47  */
48 #define HARP_TIMER(tp, time, fp)                                \
49 {                                                               \
50         (tp)->ht_ticks = (time);                                \
51         (tp)->ht_mark = 0;                                      \
52         (tp)->ht_func = (fp);                                   \
53         LINK2HEAD((tp), Harp_timer, harp_timer_head, ht_next);  \
54 }
55
56 /*
57  * Cancel a HARP user-space timer
58  *
59  *      tp      pointer to timer control block
60  */
61 #define HARP_CANCEL(tp)                                         \
62 {                                                               \
63         UNLINK((tp), Harp_timer, harp_timer_head, ht_next);     \
64 }
65
66
67 /*
68  * HARP user-space timer control block
69  */
70 struct harp_timer {
71         struct harp_timer       *ht_next;       /* Timer chain */
72         int                     ht_ticks;       /* Seconds till exp */
73         int                     ht_mark;        /* Processing flag */
74         void                    (*ht_func)();   /* Function to call */
75 };
76 typedef struct harp_timer       Harp_timer;
77
78
79 /*
80  * Externally-visible variables and functions
81  */
82
83 /* atm_addr.c */
84 extern int              get_hex_atm_addr __P((char *, u_char *, int));
85 extern char             *format_atm_addr __P((Atm_addr *));
86
87 /* cache_key.c */
88 extern void             scsp_cache_key __P((Atm_addr *,
89                                 struct in_addr  *, int, char *));
90
91 /* ioctl_subr.c */
92 extern int              do_info_ioctl __P((struct atminfreq *, int));
93 extern int              get_vcc_info __P((char *,
94                                 struct air_vcc_rsp **));
95 extern int              get_subnet_mask __P((char *,
96                                 struct sockaddr_in *));
97 extern int              get_mtu __P((char *));
98 extern int              verify_nif_name __P((char *));
99 extern int              get_cfg_info __P((char *, struct air_cfg_rsp **));
100 extern int              get_intf_info __P((char *, struct air_int_rsp **));
101 extern int              get_netif_info __P((char *, struct air_netif_rsp **));
102
103 /* ip_addr.c */
104 extern struct sockaddr_in       *get_ip_addr __P((char *));
105 extern char             *format_ip_addr __P((struct in_addr *));
106
107 /* ip_checksum.c */
108 extern short            ip_checksum __P((char *, int));
109
110 /* timer.c */
111 extern Harp_timer       *harp_timer_head;
112 extern int              harp_timer_exec;
113 extern void             timer_proc __P(());
114 extern int              init_timer __P(());
115 extern int              block_timer __P(());
116 extern void             enable_timer __P((int));
117
118
119 #endif  /* _HARP_LIBHARP_H */