netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
include/atalk/nbp.h
Go to the documentation of this file.
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
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/types.h>
33#include <netatalk/at.h>
34#include <netatalk/endian.h>
35
36/* Described in IAT 7-14 */
37
38struct nbphdr {
39#if BYTE_ORDER == BIG_ENDIAN
40 uint32_t nh_op : 4,
41 nh_cnt : 4,
42#else /* BYTE_ORDER != BIG_ENDIAN */
43 uint32_t nh_cnt : 4,
44 nh_op : 4,
45#endif /* BYTE_ORDER */
46 nh_id : 8;
47};
48
49#define SZ_NBPHDR 2
50
51
52/* NBP tuple described in IAT 7-16 */
53/* struct nbptuple is misnamed; describes only the entity address */
54struct nbptuple {
55 uint16_t nt_net;
56 uint8_t nt_node;
57 uint8_t nt_port;
58 uint8_t nt_enum;
59};
60#define SZ_NBPTUPLE 5
61
62#define NBPSTRLEN 32
63/*
64 * Name Binding Protocol Network Visible Entity
65 * This is the rest of NBP tuple in IAT 7-16
66 */
67struct nbpnve {
69 uint8_t nn_objlen;
71 uint8_t nn_typelen;
73 uint8_t nn_zonelen;
75};
76
77/*
78 * Note that NBPOP_ERROR is not standard. As Apple adds more NBPOPs,
79 * we need to check for collisions with our extra values. */
80#define NBPOP_BRRQ 0x1
81#define NBPOP_LKUP 0x2
82#define NBPOP_LKUPREPLY 0x3
83#define NBPOP_FWD 0x4
84#define NBPOP_RGSTR 0x7
85#define NBPOP_UNRGSTR 0x8
86#define NBPOP_CONFIRM 0x9
87#define NBPOP_OK 0xa /* NBPOP_STATUS_REPLY */
88#define NBPOP_CLOSE_NOTE 0xb
89
90#define NBPOP_ERROR 0xf
91
92#define NBPMATCH_NOGLOB (1<<1)
93#define NBPMATCH_NOZONE (1<<2)
94
95extern int nbp_name(const char *, char **, char **, char **);
96extern int nbp_do_lookup_op(const char *, const char *, const char *,
97 struct nbpnve *, const int,
98 const struct at_addr *, const struct at_addr *, uint8_t);
99extern int nbp_lookup(const char *, const char *, const char *,
100 struct nbpnve *, const int,
101 const struct at_addr *);
102extern int nbp_rgstr(struct sockaddr_at *,
103 const char *, const char *, const char *);
104extern int nbp_unrgstr(const char *, const char *, const char *,
105 const struct at_addr *);
106
107#endif /* NO_DDP */
108#endif
int nbp_lookup(const char *, const char *, const char *, struct nbpnve *, const int, const struct at_addr *)
Definition nbp_lkup.c:34
int nbp_name(const char *, char **, char **, char **)
Definition nbp_util.c:137
#define NBPSTRLEN
Definition include/atalk/nbp.h:62
int nbp_unrgstr(const char *, const char *, const char *, const struct at_addr *)
Definition nbp_unrgstr.c:32
int nbp_do_lookup_op(const char *, const char *, const char *, struct nbpnve *, const int, const struct at_addr *, const struct at_addr *, uint8_t)
Definition nbp_lkup.c:41
int nbp_rgstr(struct sockaddr_at *, const char *, const char *, const char *)
Definition nbp_rgstr.c:32
Definition at.h:68
Definition include/atalk/nbp.h:38
uint32_t nh_id
Definition include/atalk/nbp.h:46
uint32_t nh_op
Definition include/atalk/nbp.h:40
uint32_t nh_cnt
Definition include/atalk/nbp.h:41
Definition include/atalk/nbp.h:67
char nn_obj[NBPSTRLEN]
Definition include/atalk/nbp.h:70
struct sockaddr_at nn_sat
Definition include/atalk/nbp.h:68
uint8_t nn_objlen
Definition include/atalk/nbp.h:69
char nn_zone[NBPSTRLEN]
Definition include/atalk/nbp.h:74
uint8_t nn_typelen
Definition include/atalk/nbp.h:71
char nn_type[NBPSTRLEN]
Definition include/atalk/nbp.h:72
uint8_t nn_zonelen
Definition include/atalk/nbp.h:73
Definition include/atalk/nbp.h:54
uint16_t nt_net
Definition include/atalk/nbp.h:55
uint8_t nt_enum
Definition include/atalk/nbp.h:58
uint8_t nt_node
Definition include/atalk/nbp.h:56
uint8_t nt_port
Definition include/atalk/nbp.h:57
Definition at.h:88