]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libatm/libatm.h
Use .Fo/.Fc and .Xo/.Xc to bring the line widths below 79 columns.
[FreeBSD/FreeBSD.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$
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)(struct harp_timer *);        /* 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(const char *, u_char *, int);
85 extern char             *format_atm_addr(const Atm_addr *);
86
87 /* cache_key.c */
88 extern void             scsp_cache_key(const Atm_addr *,
89                                 const struct in_addr  *, int, char *);
90
91 /* ioctl_subr.c */
92 extern ssize_t          do_info_ioctl(struct atminfreq *, size_t);
93 extern ssize_t          get_vcc_info(const char *, struct air_vcc_rsp **);
94 extern int              get_subnet_mask(const char *, struct sockaddr_in *);
95 extern int              get_mtu(const char *);
96 extern int              verify_nif_name(const char *);
97 extern ssize_t          get_cfg_info(const char *, struct air_cfg_rsp **);
98 extern ssize_t          get_intf_info(const char *, struct air_int_rsp **);
99 extern ssize_t          get_netif_info(const char *, struct air_netif_rsp **);
100
101 /* ip_addr.c */
102 extern struct sockaddr_in       *get_ip_addr(const char *);
103 extern const char               *format_ip_addr(const struct in_addr *);
104
105 /* ip_checksum.c */
106 extern short            ip_checksum(const char *, int);
107
108 /* timer.c */
109 extern Harp_timer       *harp_timer_head;
110 extern int              harp_timer_exec;
111 extern void             timer_proc(void);
112 extern int              init_timer(void);
113 extern int              block_timer(void);
114 extern void             enable_timer(int);
115
116
117 #endif  /* _HARP_LIBHARP_H */