]> arthur.barton.de Git - netatalk.git/blob - include/atalk/nbp.h
Remove bdb env on exit
[netatalk.git] / include / atalk / nbp.h
1 /*
2  * Copyright (c) 1990,1991 Regents of The University of Michigan.
3  * All Rights Reserved.
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both that copyright notice and this permission notice appear
9  * in supporting documentation, and that the name of The University
10  * of Michigan not be used in advertising or publicity pertaining to
11  * distribution of the software without specific, written prior
12  * permission. This software is supplied as is without expressed or
13  * implied warranties of any kind.
14  *
15  *      Research Systems Unix Group
16  *      The University of Michigan
17  *      c/o Mike Clark
18  *      535 W. William Street
19  *      Ann Arbor, Michigan
20  *      +1-313-763-0525
21  *      netatalk@itd.umich.edu
22  */
23
24 #ifndef _ATALK_NBP_H
25 #define _ATALK_NBP_H 1
26
27 #ifndef NO_DDP
28
29 #define NBP_UNRGSTR_4ARGS 1
30 #define ATP_OPEN_2ARGS 1
31
32 #include <sys/cdefs.h>
33 #include <sys/types.h>
34 #include <netatalk/at.h>
35 #include <netatalk/endian.h>
36
37 struct nbphdr {
38 #if BYTE_ORDER == BIG_ENDIAN
39     unsigned    nh_op : 4,
40                 nh_cnt : 4,
41 #else /* BYTE_ORDER != BIG_ENDIAN */
42     unsigned    nh_cnt : 4,
43                 nh_op : 4,
44 #endif /* BYTE_ORDER */
45                 nh_id : 8;
46 };
47
48 #define SZ_NBPHDR       2
49
50 struct nbptuple {
51     u_int16_t   nt_net;
52     u_int8_t    nt_node;
53     u_int8_t    nt_port;
54     u_int8_t    nt_enum;
55 };
56 #define SZ_NBPTUPLE     5
57
58 #define NBPSTRLEN       32
59 /*
60  * Name Binding Protocol Network Visible Entity
61  */
62 struct nbpnve {
63     struct sockaddr_at  nn_sat;
64     u_char              nn_objlen;
65     char                nn_obj[ NBPSTRLEN ];
66     u_char              nn_typelen;
67     char                nn_type[ NBPSTRLEN ];
68     u_char              nn_zonelen;
69     char                nn_zone[ NBPSTRLEN ];
70 };
71
72 /*
73  * Note that NBPOP_ERROR is not standard. As Apple adds more NBPOPs,
74  * we need to check for collisions with our extra values.  */
75 #define NBPOP_BRRQ       0x1
76 #define NBPOP_LKUP       0x2
77 #define NBPOP_LKUPREPLY  0x3
78 #define NBPOP_FWD        0x4
79 #define NBPOP_RGSTR      0x7
80 #define NBPOP_UNRGSTR    0x8
81 #define NBPOP_CONFIRM    0x9
82 #define NBPOP_OK         0xa  /* NBPOP_STATUS_REPLY */
83 #define NBPOP_CLOSE_NOTE 0xb
84
85 #define NBPOP_ERROR      0xf
86
87 #define NBPMATCH_NOGLOB (1<<1)
88 #define NBPMATCH_NOZONE (1<<2)
89
90 extern int nbp_name (const char *, char **, char **, char **);
91 extern int nbp_lookup (const char *, const char *, const char *,
92                            struct nbpnve *, const int, 
93                            const struct at_addr *);
94 extern int nbp_rgstr (struct sockaddr_at *, 
95                           const char *, const char *, const char *);
96 extern int nbp_unrgstr (const char *, const char *, const char *,
97                             const struct at_addr *);
98
99 #endif  /* NO_DDP */
100 #endif