if ((c = getoption(buf, "-port")))
options->port = strdup(c);
+#ifndef NO_DDP
if ((c = getoption(buf, "-ddpaddr")))
atalk_aton(c, &options->ddpaddr);
+#endif
if ((c = getoption(buf, "-signature")) && (opt = strdup(c)))
options->signatureopt = opt;
static struct uam_obj *afp_uam = NULL;
-void status_versions( char *data, const ASP asp, const DSI *dsi)
+void status_versions(char *data,
+#ifndef NO_DDP
+ const ASP asp,
+#endif
+ const DSI *dsi)
{
char *start = data;
u_int16_t status;
/* extract the obj part of the server */
Obj = (char *) server;
+#ifndef NO_DDP
nbp_name(server, &Obj, &Type, &Zone);
+#endif
if ((size_t)-1 == (len = convert_string(
- options->unixcharset, options->maccharset,
- Obj, -1, buf, sizeof(buf))) ) {
- len = MIN(strlen(Obj), 31);
+ options->unixcharset, options->maccharset,
+ Obj, -1, buf, sizeof(buf))) ) {
+ len = MIN(strlen(Obj), 31);
*data++ = len;
memcpy( data, Obj, len );
- LOG ( log_error, logtype_afpd, "Could not set servername, using fallback");
+ LOG ( log_error, logtype_afpd, "Could not set servername, using fallback");
} else {
*data++ = len;
memcpy( data, buf, len );
}
static size_t status_netaddress(char *data, int *servoffset,
- const ASP asp, const DSI *dsi,
- const struct afp_options *options)
+#ifndef NO_DDP
+ const ASP asp,
+#endif
+ const DSI *dsi,
+ const struct afp_options *options)
{
char *begin;
u_int16_t offset;
/* number of addresses. this currently screws up if we have a dsi
connection, but we don't have the ip address. to get around this,
we turn off the status flag for tcp/ip. */
- *data++ = ((options->fqdn && dsi)? 1 : 0) + (dsi ? 1 : 0) + (asp ? 1 : 0) +
+ *data++ = ((options->fqdn && dsi)? 1 : 0) + (dsi ? 1 : 0) +
+#ifndef NO_DDP
+ (asp ? 1 : 0) +
+#endif
(((options->flags & OPTION_ANNOUNCESSH) && options->fqdn && dsi)? 1 : 0);
/* ip address */
/* extract the obj part of the server */
Obj = (char *) (options->server ? options->server : options->hostname);
+#ifndef NO_DDP
nbp_name(options->server ? options->server : options->hostname, &Obj, &Type, &Zone);
-
+#endif
if ((size_t) -1 == (len = convert_string (
options->unixcharset, CH_UTF8_MAC,
Obj, -1, data+sizeof(namelen), maxstatuslen-offset )) ) {
void status_init(AFPConfig *aspconfig, AFPConfig *dsiconfig,
const struct afp_options *options)
{
+#ifndef NO_DDP
ASP asp;
+#endif
DSI *dsi;
char *status = NULL;
size_t statuslen;
if (!(aspconfig || dsiconfig) || !options)
return;
+#ifndef NO_DDP
if (aspconfig) {
status = aspconfig->status;
maxstatuslen=sizeof(aspconfig->status);
asp = aspconfig->obj.handle;
} else
asp = NULL;
+#endif
ipok = 0;
if (dsiconfig) {
c = status_server(status, options->server ? options->server :
options->hostname, options);
status_machine(status);
- status_versions(status, asp, dsi);
+ status_versions(status,
+#ifndef NO_DDP
+ asp,
+#endif
+ dsi);
status_uams(status, options->uamlist);
if (options->flags & OPTION_CUSTOMICON)
status_icon(status, icon, sizeof(icon), c);
sigoff = status_signature(status, &c, options);
/* c now contains the offset where the netaddress offset lives */
- status_netaddress(status, &c, asp, dsi, options);
+ status_netaddress(status, &c,
+#ifndef NO_DDP
+ asp,
+#endif
+ dsi, options);
/* c now contains the offset where the Directory Names Count offset lives */
statuslen = status_directorynames(status, &c, dsi, options);
#define PASSWD_NOSAVE (1 << 1)
#define PASSWD_ALL (PASSWD_SET | PASSWD_NOSAVE)
-extern void status_versions (char * /*status*/, const ASP, const DSI *);
+extern void status_versions (char * /*status*/,
+#ifndef NO_DDP
+ const ASP,
+#endif
+ const DSI *);
extern void status_uams (char * /*status*/, const char * /*authlist*/);
extern void status_init (AFPConfig *, AFPConfig *,
const struct afp_options *);
return AFPERR_PARAM;
switch (obj->proto) {
+#ifndef NO_DDP
case AFPPROTO_ASP:
if ((len = asp_wrtcont(obj->handle, buf, buflen )) < 0)
goto uam_afp_read_err;
return action(handle, buf, *buflen);
break;
-
+#endif
case AFPPROTO_DSI:
len = dsi_writeinit(obj->handle, buf, *buflen);
if (!len || ((len = action(handle, buf, len)) < 0)) {
}
}
break;
+ default:
+ return -1;
}
return 0;
} else if (is_var(p, "$c")) {
if (afpmaster && xlatevolname)
return NULL;
+#ifndef NO_DDP
if (obj->proto == AFPPROTO_ASP) {
ASP asp = obj->handle;
dest += len;
destlen -= len;
- } else if (obj->proto == AFPPROTO_DSI) {
+ }
+#endif
+ if (obj->proto == AFPPROTO_DSI) {
DSI *dsi = obj->handle;
len = sprintf(dest, "%s:%u",
getip_string((struct sockaddr *)&dsi->client),
} else if (is_var(p, "$i")) {
if (afpmaster && xlatevolname)
return NULL;
+#ifndef NO_DDP
if (obj->proto == AFPPROTO_ASP) {
ASP asp = obj->handle;
-
len = sprintf(dest, "%u", ntohs(asp->asp_sat.sat_addr.s_net));
dest += len;
destlen -= len;
- } else if (obj->proto == AFPPROTO_DSI) {
+ }
+#endif
+ if (obj->proto == AFPPROTO_DSI) {
DSI *dsi = obj->handle;
q = getip_string((struct sockaddr *)&dsi->client);
}
#ifndef _ATALK_AEP_H
#define _ATALK_AEP_H 1
+#ifndef NO_DDP
+
#define AEPOP_REQUEST 1
#define AEPOP_REPLY 2
+#endif /* NO_DDP */
#endif
#ifndef _ATALK_ASP_H
#define _ATALK_ASP_H 1
+#ifndef NO_DDP
+
#include <sys/types.h>
#include <sys/cdefs.h>
#include <netatalk/endian.h>
extern int asp_tickle (ASP, const u_int8_t, struct sockaddr_at *);
extern void asp_stop_tickle (void);
+#endif /* NO_DDP */
#endif
#ifndef _ATALK_ATP_H
#define _ATALK_ATP_H 1
+
+#ifndef NO_DDP
#include <sys/cdefs.h>
#include <sys/types.h>
extern int atp_rreq (ATP, struct atp_block *);
extern int atp_sresp (ATP, struct atp_block *);
+#endif /* NO_DDP */
#endif
#ifndef _ATALK_DDP_H
#define _ATALK_DDP_H 1
+#ifndef NO_DDP
+
#define DDPTYPE_RTMPRD 1
#define DDPTYPE_NBP 2
#define DDPTYPE_ATP 3
#define DDPTYPE_ZIP 6
#define DDPTYPE_ADSP 7
+#endif /* NO_DDP */
#endif
u_int32_t server_quantum;
int dsireadbuf; /* scale factor for sizefof(dsi->buffer) = server_quantum * dsireadbuf */
char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile;
+#ifndef NO_DDP
struct at_addr ddpaddr;
+#endif
char *uampath, *fqdn;
char *pidfile;
char *sigconffile;
#ifndef _ATALK_NBP_H
#define _ATALK_NBP_H 1
+
+#ifndef NO_DDP
+
#define NBP_UNRGSTR_4ARGS 1
#define ATP_OPEN_2ARGS 1
extern int nbp_unrgstr (const char *, const char *, const char *,
const struct at_addr *);
+#endif /* NO_DDP */
#endif
#ifndef _ATALK_NETDDP_H
#define _ATALK_NETDDP_H 1
+#ifndef NO_DDP
+
#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/socket.h>
#define netddp_recvfrom recvfrom
#endif
+#endif /* NO_DDP */
#endif /* netddp.h */
#ifndef _ATALK_PAP_H
#define _ATALK_PAP_H 1
+#ifndef NO_DDP
+
#define PAP_OPEN 1
#define PAP_OPENREPLY 2
#define PAP_READ 3
#define PAP_MAXDATA 512
#define PAP_MAXQUANTUM 8
+#endif /* NO_DDP */
#endif
#ifndef _ATALK_RTMP_H
#define _ATALK_RTMP_H 1
+#ifndef NO_DDP
+
#include <netatalk/endian.h>
#define RTMPROP_REQUEST 1
u_int8_t rrdh_id;
};
+#endif /* NO_DDP */
#endif
#define diatolower(x) _dialowermap[(unsigned char) (x)]
#define diatoupper(x) _diacasemap[(unsigned char) (x)]
+#ifndef NO_DDP
extern int atalk_aton (char *, struct at_addr *);
+#endif
extern void bprint (char *, int);
extern int strdiacasecmp (const char *, const char *);
extern int strndiacasecmp (const char *, const char *, size_t);
#ifndef _ATALK_ZIP_H
#define _ATALK_ZIP_H 1
+#ifndef NO_DDP
+
#include <netatalk/endian.h>
struct ziphdr {
#define ZIPGNI_INVALID 0x80
#define ZIPGNI_ONEZONE 0x20
+#endif /* NO_DDP */
#endif
# Makefile.am for libatalk/
-SUBDIRS = acl adouble asp atp bstring compat cnid dsi nbp netddp tdb util unicode vfs
+SUBDIRS = acl adouble bstring compat cnid dsi tdb util unicode vfs
lib_LTLIBRARIES = libatalk.la
libatalk_la_LIBADD = \
acl/libacl.la \
adouble/libadouble.la \
- asp/libasp.la \
- atp/libatp.la \
bstring/libbstring.la \
compat/libcompat.la \
dsi/libdsi.la \
- nbp/libnbp.la \
- netddp/libnetddp.la \
util/libutil.la \
tdb/libtdb.la \
unicode/libunicode.la \
libatalk_la_LDFLAGS = -static
+if USE_APPLETALK
+SUBDIRS += asp atp nbp netddp
+libatalk_la_LIBADD += \
+ asp/libasp.la \
+ atp/libatp.la \
+ nbp/libnbp.la \
+ netddp/libnetddp.la
+libatalk_la_DEPENDENCIES += \
+ asp/libasp.la \
+ atp/libatp.la \
+ nbp/libnbp.la \
+ netddp/libnetddp.la
+endif
#include "config.h"
#endif
+#ifndef NO_DDP
+
#include <sys/types.h>
#include <netatalk/at.h>
#include <netatalk/endian.h>
}
return (1);
}
+
+#endif /* NO_DDP */
/*
- * $Id: at.h,v 1.6 2008-12-18 17:31:31 morgana Exp $
- *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
*
* All Rights Reserved. See COPYRIGHT.
#ifndef __AT_HEADER__
#define __AT_HEADER__
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#ifndef NO_DDP
+
#if defined(linux) /* pull in the linux header */
#include <sys/socket.h>
#include <asm/types.h>
#endif /* KERNEL */
#endif /* linux */
+#endif /* NO_DDP */
#endif /* __AT_HEADER__ */