netatalk
4.6.0
Free and Open Source Apple Filing Protocol (AFP) Server
Toggle main menu visibility
Loading...
Searching...
No Matches
asp.h
Go to the documentation of this file.
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
#ifndef _ATALK_ASP_H
25
#define _ATALK_ASP_H 1
26
27
#ifndef NO_DDP
28
29
#include <sys/types.h>
30
#include <
netatalk/at.h
>
31
#include <
atalk/atp.h
>
32
#include <
atalk/afp.h
>
33
#include <
atalk/server_child.h
>
34
35
#define ASP_HDRSIZ 4
36
#define ASP_CMDSIZ 578
37
38
#define ASP_MAXPACKETS 8
39
#define ASP_CMDMAXSIZ (ASP_CMDSIZ + ASP_HDRSIZ)
40
#define ASP_DATASIZ (ASP_CMDSIZ*ASP_MAXPACKETS)
41
#define ASP_DATAMAXSIZ ((ASP_CMDSIZ + ASP_HDRSIZ)*ASP_MAXPACKETS)
42
43
/* asp_getrequest() results: >0 the command byte, 0 session ended */
44
#define ASP_ERR_READ (-1)
45
#define ASP_ERR_SEQ (-2)
46
#define ASP_ERR_SID (-3)
47
#define ASP_NOREQUEST (-4)
48
49
typedef
struct
ASP
{
50
ATP
asp_atp
;
51
struct
sockaddr_at
asp_sat
;
52
uint8_t
asp_wss
;
53
uint8_t
asp_sid
;
54
union
{
55
struct
{
56
char
*
as_status
;
57
int
as_slen
;
58
}
asu_status
;
59
uint16_t
asu_seq
;
60
}
asp_u
;
61
#define asp_status asp_u.asu_status.as_status
62
#define asp_slen asp_u.asu_status.as_slen
63
#define asp_seq asp_u.asu_seq
64
int
asp_flags
;
65
char
child
,
inited
, *
commands
;
66
char
cmdbuf
[
ASP_CMDMAXSIZ
];
67
char
data
[
ASP_DATAMAXSIZ
];
68
size_t
cmdlen
,
datalen
;
69
off_t
read_count
,
write_count
;
70
int
asp_ipc_fd
;
71
int
asp_hint_fd
;
72
int
asp_cnx_cnt
;
73
int
asp_cnx_max
;
74
} *
ASP
;
75
76
#define ASPFL_SLS 1
77
#define ASPFL_SSS 2
78
79
#define ASPFUNC_CLOSE 1
80
#define ASPFUNC_CMD 2
81
#define ASPFUNC_STAT 3
82
#define ASPFUNC_OPEN 4
83
#define ASPFUNC_TICKLE 5
84
#define ASPFUNC_WRITE 6
85
#define ASPFUNC_WRTCONT 7
86
#define ASPFUNC_ATTN 8
87
88
#define ASPERR_OK 0x0000
89
#define ASPERR_BADVERS 0xfbd6
90
#define ASPERR_BUFSMALL 0xfbd5
91
#define ASPERR_NOSESS 0xfbd4
92
#define ASPERR_NOSERV 0xfbd3
93
#define ASPERR_PARM 0xfbd2
94
#define ASPERR_SERVBUSY 0xfbd1
95
#define ASPERR_SESSCLOS 0xfbd0
96
#define ASPERR_SIZERR 0xfbcf
97
#define ASPERR_TOOMANY 0xfbce
98
#define ASPERR_NOACK 0xfbcd
99
100
extern
ASP
asp_init
(
ATP
);
101
extern
void
asp_setstatus
(
ASP
,
char
*,
const
int
);
102
extern
ASP
asp_getsession
(
ASP
,
server_child_t
*,
const
int
,
afp_child_t
**);
103
extern
int
asp_close
(
ASP
);
104
extern
int
asp_shutdown
(
ASP
);
105
extern
int
asp_attention
(
ASP
,
AFPUserBytes
);
106
extern
int
asp_getrequest
(
ASP
);
107
extern
int
asp_cmdreply
(
ASP
,
int
);
108
extern
int
asp_wrtcont
(
ASP
,
char
*,
size_t
*);
109
#define asp_wrtreply(a,b) asp_cmdreply((a), (b))
110
extern
void
asp_kill
(
int
);
111
extern
int
asp_tickle
(
ASP
,
const
uint8_t,
struct
sockaddr_at
*);
112
extern
void
asp_stop_tickle
(
void
);
113
114
#endif
/* NO_DDP */
115
#endif
afp.h
AFPUserBytes
uint16_t AFPUserBytes
Definition
afp.h:30
asp_stop_tickle
void asp_stop_tickle(void)
Definition
asp_getsess.c:90
asp_getsession
ASP asp_getsession(ASP, server_child_t *, const int, afp_child_t **)
This call handles open, tickle, and getstatus requests.
Definition
asp_getsess.c:106
asp_attention
int asp_attention(ASP, AFPUserBytes)
Definition
asp_attn.c:24
asp_kill
void asp_kill(int)
Definition
asp_getsess.c:83
asp_shutdown
int asp_shutdown(ASP)
Definition
asp_shutdown.c:18
asp_close
int asp_close(ASP)
Definition
asp_close.c:39
asp_wrtcont
int asp_wrtcont(ASP, char *, size_t *)
Definition
asp_write.c:35
ASP_DATAMAXSIZ
#define ASP_DATAMAXSIZ
Definition
asp.h:41
ASP_CMDMAXSIZ
#define ASP_CMDMAXSIZ
Definition
asp.h:39
asp_setstatus
void asp_setstatus(ASP, char *, const int)
Definition
asp_init.c:67
asp_getrequest
int asp_getrequest(ASP)
Definition
asp_getreq.c:48
asp_init
ASP asp_init(ATP)
Definition
asp_init.c:39
asp_cmdreply
int asp_cmdreply(ASP, int)
Definition
asp_cmdreply.c:36
asp_tickle
int asp_tickle(ASP, const uint8_t, struct sockaddr_at *)
Definition
asp_tickle.c:20
at.h
atp.h
ATP packet format.
ATP
struct atp_handle * ATP
Definition
atp.h:124
server_child.h
data structures and utility functions for child processes
afp_child_t
struct afp_child afp_child_t
ASP::[union].asp_u::[struct].asp_u.asu_status::as_slen
int as_slen
ASP::[union].asp_u::[struct].asp_u.asu_status::as_status
char * as_status
ASP
Definition
asp.h:49
ASP::asp_sat
struct sockaddr_at asp_sat
Definition
asp.h:51
ASP::asp_hint_fd
int asp_hint_fd
Definition
asp.h:71
ASP::cmdbuf
char cmdbuf[ASP_CMDMAXSIZ]
Definition
asp.h:66
ASP::asp_cnx_cnt
int asp_cnx_cnt
Definition
asp.h:72
ASP::asp_atp
ATP asp_atp
Definition
asp.h:50
ASP::asp_u
union ASP::@347231267346030044172137237055100240124305324314 asp_u
ASP::cmdlen
size_t cmdlen
Definition
asp.h:68
ASP::datalen
size_t datalen
Definition
asp.h:68
ASP::inited
char inited
Definition
asp.h:65
ASP::data
char data[ASP_DATAMAXSIZ]
Definition
asp.h:67
ASP::asp_flags
int asp_flags
Definition
asp.h:64
ASP::asp_ipc_fd
int asp_ipc_fd
Definition
asp.h:70
ASP::read_count
off_t read_count
Definition
asp.h:69
ASP::child
char child
Definition
asp.h:65
ASP::write_count
off_t write_count
Definition
asp.h:69
ASP::asp_wss
uint8_t asp_wss
Definition
asp.h:52
ASP::asp_cnx_max
int asp_cnx_max
Definition
asp.h:73
ASP::commands
char * commands
Definition
asp.h:65
ASP::asp_sid
uint8_t asp_sid
Definition
asp.h:53
server_child_t
Definition
server_child.h:47
sockaddr_at
Definition
at.h:88
ASP::[union].asp_u::asu_seq
uint16_t asu_seq
ASP::[union].asp_u::asu_status
struct ASP::@347231267346030044172137237055100240124305324314::@006274300230261210233173200336164253152035035247 asu_status
include
atalk
asp.h
Generated by
1.18.0