2 * $Id: asp_shutdown.c,v 1.4 2009-10-13 22:55:37 didg Exp $
4 * Copyright (c) 1996 Regents of The University of Michigan.
5 * All Rights Reserved. See COPYRIGHT.
10 #endif /* HAVE_CONFIG_H */
13 #include <sys/types.h>
16 #include <netatalk/endian.h>
17 #include <netatalk/at.h>
18 #include <atalk/atp.h>
19 #include <atalk/asp.h>
21 int asp_shutdown(ASP asp)
23 struct atp_block atpb;
34 memcpy( p, &seq, sizeof(seq));
37 oport = asp->asp_sat.sat_port;
38 atpb.atp_saddr = &asp->asp_sat;
39 atpb.atp_saddr->sat_port = asp->asp_wss;
40 atpb.atp_sreqdata = asp->commands;
41 atpb.atp_sreqdlen = p - asp->commands;
43 atpb.atp_sreqtries = 5;
45 if ( atp_sreq( asp->asp_atp, &atpb, 1, ATP_XO ) < 0 ) {
46 asp->asp_sat.sat_port = oport;
50 iov.iov_base = asp->commands;
51 iov.iov_len = ASP_CMDSIZ;
52 atpb.atp_rresiov = &iov;
53 atpb.atp_rresiovcnt = 1;
55 if ( atp_rresp( asp->asp_atp, &atpb ) < 0 ) {
56 asp->asp_sat.sat_port = oport;
59 asp->asp_sat.sat_port = oport;