2 * Copyright (c) 1996 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
11 #include <sys/types.h>
14 #include <netatalk/endian.h>
15 #include <netatalk/at.h>
16 #include <atalk/atp.h>
17 #include <atalk/asp.h>
19 int asp_shutdown( asp )
22 struct atp_block atpb;
33 memcpy( p, &seq, sizeof(seq));
36 oport = asp->asp_sat.sat_port;
37 atpb.atp_saddr = &asp->asp_sat;
38 atpb.atp_saddr->sat_port = asp->asp_wss;
39 atpb.atp_sreqdata = asp->commands;
40 atpb.atp_sreqdlen = p - asp->commands;
42 atpb.atp_sreqtries = 5;
44 if ( atp_sreq( asp->asp_atp, &atpb, 1, ATP_XO ) < 0 ) {
45 asp->asp_sat.sat_port = oport;
49 iov.iov_base = asp->commands;
50 iov.iov_len = ASP_CMDSIZ;
51 atpb.atp_rresiov = &iov;
52 atpb.atp_rresiovcnt = 1;
54 if ( atp_rresp( asp->asp_atp, &atpb ) < 0 ) {
55 asp->asp_sat.sat_port = oport;
58 asp->asp_sat.sat_port = oport;