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