/*
-* "$Id: pap.c 7010 2007-10-10 21:08:51Z mike $"
+* "$Id: pap.c 7720 2008-07-11 22:46:21Z mike $"
*
-* © Copyright 2004 Apple Computer, Inc. All rights reserved.
+* Copyright 2004-2008 Apple Inc. All rights reserved.
*
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
* Inc. ("Apple") in consideration of your agreement to the following
* signalHandler() - handle SIGINT to close the session before quiting.
*/
+/*
+ * This backend uses deprecated APIs for AppleTalk; we know this, so
+ * silence any warnings about it...
+ */
+
+#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
+# undef MAC_OS_X_VERSION_MIN_REQUIRED
+#endif /* MAX_OS_X_VERSION_MIN_REQUIRED */
+#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_0
+
#include <config.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/errno.h>
+#include <cups/cups.h>
+#include <cups/backend.h>
+#include <cups/sidechannel.h>
+#include <cups/i18n.h>
+
#include <netat/appletalk.h>
#include <netat/atp.h>
#include <netat/ddp.h>
#include <netat/nbp.h>
#include <netat/pap.h>
-#include <cups/cups.h>
-#include <cups/backend.h>
-#include <cups/sidechannel.h>
-#include <cups/i18n.h>
-
#include <libkern/OSByteOrder.h>
#ifdef HAVE_APPLETALK_AT_PROTO_H
*/
static int listDevices(void)
{
- int err = noErr;
int i;
int numberFound;
return -1; /* Network is down */
}
- if ((err = zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone)) != 0)
+ if (zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone))
{
_cupsLangPrintError(_("ERROR: Unable to get default AppleTalk zone"));
return -2;
at_inet_t sendDataAddr;
at_inet_t src;
at_resp_t resp;
- int userdata, xo, reqlen;
+ int userdata, xo = 0, reqlen;
u_short tid;
u_char bitmap;
int maxfdp1,
nbp_failures = 0;
struct timeval timeout, *timeoutPtr;
u_char flowQuantum = 1;
- u_short recvSequence = 0;
time_t now,
start_time,
elasped_time,
case AT_PAP_TYPE_SEND_DATA: /* Send-Data packet */
sendDataAddr.socket = src.socket;
gSendDataID = tid;
- recvSequence = OSReadBigInt16(&SEQUENCE_NUM(userdata), 0);
+ OSReadBigInt16(&SEQUENCE_NUM(userdata), 0);
if ((fileBufferNbytes > 0 || fileEOFRead) && fileEOFSent == false)
{
{
int result,
open_result,
- userdata,
- atp_err;
+ userdata;
time_t tm,
waitTime;
char data[10],
fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN));
- if ((atp_err = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
- 0, &resp, &retry, 0)) < 0)
+ if (atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
+ 0, &resp, &retry, 0) < 0)
{
statusUpdate("Destination unreachable", 23);
result = EHOSTUNREACH;
{
int fd;
u_short tmpID;
- int result;
unsigned char rdata[ATP_DATA_SIZE];
int userdata;
u_char *puserdata = (u_char *)&userdata;
resp.resp[0].iov_base = rdata;
resp.resp[0].iov_len = sizeof(rdata);
- result = atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0);
+ atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0);
- result = close(fd);
+ close(fd);
}
return noErr;
}