1191551f9ddda11315a45e4e4159882d9a186a8a
[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  *      @(#) $DragonFly: src/lib/libatm/libatm.h,v 1.2 2003/06/17 04:26:41 dillon Exp $
28  *
29  */
30
31 /*
32  * User Space Library Functions
33  * ----------------------------
34  *
35  * Library functions
36  *
37  */
38
39 #ifndef _HARP_LIBHARP_H
40 #define _HARP_LIBHARP_H
41
42 /*
43  * Start a HARP user-space timer
44  *
45  *      tp      pointer to timer control block
46  *      time    number of seconds for timer to run
47  *      fp      pointer to function to call at expiration
48  */
49 #define HARP_TIMER(tp, time, fp)                                \
50 {                                                               \
51         (tp)->ht_ticks = (time);                                \
52         (tp)->ht_mark = 0;                                      \
53         (tp)->ht_func = (fp);                                   \
54         LINK2HEAD((tp), Harp_timer, harp_timer_head, ht_next);  \
55 }
56
57 /*
58  * Cancel a HARP user-space timer
59  *
60  *      tp      pointer to timer control block
61  */
62 #define HARP_CANCEL(tp)                                         \
63 {                                                               \
64         UNLINK((tp), Harp_timer, harp_timer_head, ht_next);     \
65 }
66
67
68 /*
69  * HARP user-space timer control block
70  */
71 struct harp_timer {
72         struct harp_timer       *ht_next;       /* Timer chain */
73         int                     ht_ticks;       /* Seconds till exp */
74         int                     ht_mark;        /* Processing flag */
75         void                    (*ht_func)();   /* Function to call */
76 };
77 typedef struct harp_timer       Harp_timer;
78
79
80 /*
81  * Externally-visible variables and functions
82  */
83
84 /* atm_addr.c */
85 extern int              get_hex_atm_addr __P((char *, u_char *, int));
86 extern char             *format_atm_addr __P((Atm_addr *));
87
88 /* cache_key.c */
89 extern void             scsp_cache_key __P((Atm_addr *,
90                                 struct in_addr  *, int, char *));
91
92 /* ioctl_subr.c */
93 extern int              do_info_ioctl __P((struct atminfreq *, int));
94 extern int              get_vcc_info __P((char *,
95                                 struct air_vcc_rsp **));
96 extern int              get_subnet_mask __P((char *,
97                                 struct sockaddr_in *));
98 extern int              get_mtu __P((char *));
99 extern int              verify_nif_name __P((char *));
100 extern int              get_cfg_info __P((char *, struct air_cfg_rsp **));
101 extern int              get_intf_info __P((char *, struct air_int_rsp **));
102 extern int              get_netif_info __P((char *, struct air_netif_rsp **));
103
104 /* ip_addr.c */
105 extern struct sockaddr_in       *get_ip_addr __P((char *));
106 extern char             *format_ip_addr __P((struct in_addr *));
107
108 /* ip_checksum.c */
109 extern short            ip_checksum __P((char *, int));
110
111 /* timer.c */
112 extern Harp_timer       *harp_timer_head;
113 extern int              harp_timer_exec;
114 extern void             timer_proc __P(());
115 extern int              init_timer __P(());
116 extern int              block_timer __P(());
117 extern void             enable_timer __P((int));
118
119
120 #endif  /* _HARP_LIBHARP_H */