]> arthur.barton.de Git - netatalk.git/blob - libatalk/asp/asp_init.c
massive commenting/autoconf changes
[netatalk.git] / libatalk / asp / asp_init.c
1 /*
2  * $Id: asp_init.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
3  *
4  * Copyright (c) 1990,1991 Regents of The University of Michigan.
5  * All Rights Reserved.
6  *
7  * Permission to use, copy, modify, and distribute this software and
8  * its documentation for any purpose and without fee is hereby granted,
9  * provided that the above copyright notice appears in all copies and
10  * that both that copyright notice and this permission notice appear
11  * in supporting documentation, and that the name of The University
12  * of Michigan not be used in advertising or publicity pertaining to
13  * distribution of the software without specific, written prior
14  * permission. This software is supplied as is without expressed or
15  * implied warranties of any kind.
16  *
17  *      Research Systems Unix Group
18  *      The University of Michigan
19  *      c/o Mike Clark
20  *      535 W. William Street
21  *      Ann Arbor, Michigan
22  *      +1-313-763-0525
23  *      netatalk@itd.umich.edu
24  */
25
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif /* HAVE_CONFIG_H */
29
30 #include <sys/types.h>
31 #include <sys/time.h>
32 #include <sys/uio.h>
33 #include <sys/socket.h>
34 #include <sys/param.h>
35 #include <netatalk/at.h>
36 #include <atalk/atp.h>
37 #include <atalk/asp.h>
38 #include <stdio.h>
39 #include <stdlib.h>
40
41 ASP asp_init( atp )
42     ATP         atp;
43 {
44     ASP         asp;
45
46     if (( asp = (struct ASP *)calloc(1, sizeof( struct ASP ))) == NULL ) {
47         return( NULL );
48     }
49
50     asp->asp_atp = atp;
51 #ifdef BSD4_4
52     asp->asp_sat.sat_len = sizeof( struct sockaddr_at );
53 #endif /* BSD4_4 */
54     asp->asp_sat.sat_family = AF_APPLETALK;
55     asp->asp_sat.sat_addr.s_net = ATADDR_ANYNET;
56     asp->asp_sat.sat_addr.s_node = ATADDR_ANYNODE;
57     asp->asp_sat.sat_port = ATADDR_ANYPORT;
58     asp->asp_status = NULL;
59     asp->asp_slen = 0;
60     asp->asp_sid = 0;
61     asp->asp_flags = ASPFL_SLS;
62     asp->cmdlen = asp->datalen = 0;
63     asp->read_count = asp->write_count = 0;
64     asp->commands = asp->cmdbuf + 4;
65
66     return( asp );
67 }
68
69 void asp_setstatus( asp, status, slen )
70     ASP         asp;
71     char        *status;
72     const int   slen;
73 {
74     asp->asp_status = status;
75     asp->asp_slen = slen;
76 }