2 * $Id: asp_shutdown.c,v 1.3 2001-06-29 14:14:46 rufustfirefly 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 )
24 struct atp_block atpb;
35 memcpy( p, &seq, sizeof(seq));
38 oport = asp->asp_sat.sat_port;
39 atpb.atp_saddr = &asp->asp_sat;
40 atpb.atp_saddr->sat_port = asp->asp_wss;
41 atpb.atp_sreqdata = asp->commands;
42 atpb.atp_sreqdlen = p - asp->commands;
44 atpb.atp_sreqtries = 5;
46 if ( atp_sreq( asp->asp_atp, &atpb, 1, ATP_XO ) < 0 ) {
47 asp->asp_sat.sat_port = oport;
51 iov.iov_base = asp->commands;
52 iov.iov_len = ASP_CMDSIZ;
53 atpb.atp_rresiov = &iov;
54 atpb.atp_rresiovcnt = 1;
56 if ( atp_rresp( asp->asp_atp, &atpb ) < 0 ) {
57 asp->asp_sat.sat_port = oport;
60 asp->asp_sat.sat_port = oport;