netatalk 4.4.3
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
fork.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1990,1993 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
4 */
5
6#ifndef AFPD_FORK_H
7#define AFPD_FORK_H 1
8
9#include <arpa/inet.h>
10#include <stdio.h>
11
12#include <atalk/adouble.h>
13
14#include "directory.h"
15#include "volume.h"
16
17 struct file_key {
18 dev_t dev;
19 ino_t inode;
20};
21
22 struct ofork {
23 struct file_key key;
24 struct adouble *of_ad;
25 struct vol *of_vol;
26 cnid_t of_did;
27 uint16_t of_refnum;
28 int of_flags;
29 struct ofork **prevp, *next;
30};
31
32#define OPENFORK_DATA (0)
33#define OPENFORK_RSCS (1<<7)
34
35#define OPENACC_RD (1<<0)
36#define OPENACC_WR (1<<1)
37#define OPENACC_DRD (1<<4)
38#define OPENACC_DWR (1<<5)
39
40/* ofork.of_flags bits */
41#define AFPFORK_DATA (1<<0)
42#define AFPFORK_RSRC (1<<1)
43#define AFPFORK_META (1<<2)
44#define AFPFORK_DIRTY (1<<3)
45#define AFPFORK_ACCRD (1<<4)
46#define AFPFORK_ACCWR (1<<5)
47#define AFPFORK_ACCMASK (AFPFORK_ACCRD | AFPFORK_ACCWR)
48#define AFPFORK_MODIFIED (1<<6)
49#define AFPFORK_ERROR (1<<7)
50
51#define of_name(a) (a)->of_ad->ad_name
52/* in ofork.c */
53 extern struct ofork *of_alloc(struct vol *, struct dir *,
54 char *, uint16_t *, const int,
55 struct adouble *,
56 struct stat *);
57 extern void of_dealloc(struct ofork *);
58 extern struct ofork *of_find(const uint16_t);
59 extern struct ofork *of_findname(const struct vol *vol, struct path *);
60 extern int of_rename(const struct vol *,
61 struct ofork *,
62 struct dir *, const char *,
63 struct dir *, const char *);
64 extern int of_flush(const struct vol *);
65 extern void of_pforkdesc(FILE *);
66 extern int of_stat(const struct vol *vol, struct path *);
67 extern int of_statdir(struct vol *vol, struct path *);
68 extern int of_closefork(const AFPObj *obj, struct ofork *ofork);
69 extern void of_closevol(const AFPObj *obj, const struct vol *vol);
70 extern void of_close_all_forks(const AFPObj *obj);
71 extern struct adouble *of_ad(const struct vol *, struct path *,
72 struct adouble *);
73 extern struct ofork *of_findnameat(int dirfd, struct path *path);
74 extern int of_fstatat(int dirfd, struct path *path);
75
76
77/* in fork.c */
78 extern int flushfork(struct ofork *);
79
80/* FP functions */
81 int afp_openfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
82 size_t *rbuflen);
83 int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
84 size_t *rbuflen);
85 int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
86 size_t *rbuflen);
87 int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
88 size_t *rbuflen);
89 int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
90 size_t *rbuflen);
91 int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
92 size_t *rbuflen);
93 int afp_flushfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
94 size_t *rbuflen);
95 int afp_flush(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
96 size_t *rbuflen);
97 int afp_closefork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
98 size_t *rbuflen);
99
100 int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
101 size_t *rbuflen);
102 int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
103 size_t *rbuflen);
104 int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
105 size_t *rbuflen);
106 int afp_syncfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
107 size_t *rbuflen);
108#endif
adouble.h
Part of Netatalk's AppleDouble implementatation.
cnid_t
uint32_t cnid_t
Definition adouble.h:156
rbuflen
static size_t rbuflen
Definition afpfunc_helpers.c:45
rbuf
static char rbuf[rbufsize]
Definition afpfunc_helpers.c:44
directory.h
volume.h
of_stat
int of_stat(const struct vol *vol, struct path *)
Definition ofork.c:272
of_flush
int of_flush(const struct vol *)
Definition ofork.c:86
of_dealloc
void of_dealloc(struct ofork *)
Definition ofork.c:412
of_findname
struct ofork * of_findname(const struct vol *vol, struct path *)
Definition ofork.c:353
of_find
struct ofork * of_find(const uint16_t)
Definition ofork.c:262
afp_closefork
int afp_closefork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1238
of_statdir
int of_statdir(struct vol *vol, struct path *)
stat the current directory.
Definition ofork.c:305
of_findnameat
struct ofork * of_findnameat(int dirfd, struct path *path)
Search for open fork by dirfd/name.
Definition ofork.c:387
afp_bytelock
int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:841
afp_setforkparams
int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:579
of_pforkdesc
void of_pforkdesc(FILE *)
Definition ofork.c:71
of_closevol
void of_closevol(const AFPObj *obj, const struct vol *vol)
Definition ofork.c:557
of_alloc
struct ofork * of_alloc(struct vol *, struct dir *, char *, uint16_t *, const int, struct adouble *, struct stat *)
Definition ofork.c:147
afp_flush
int afp_flush(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1119
afp_flushfork
int afp_flushfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1136
of_ad
struct adouble * of_ad(const struct vol *, struct path *, struct adouble *)
Definition ofork.c:538
of_rename
int of_rename(const struct vol *, struct ofork *, struct dir *, const char *, struct dir *, const char *)
Definition ofork.c:104
afp_getforkparams
int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1572
afp_write_ext
int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1565
of_fstatat
int of_fstatat(int dirfd, struct path *path)
Definition ofork.c:287
afp_syncfork
int afp_syncfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1168
afp_read
int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1105
afp_write
int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1556
afp_bytelock_ext
int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:848
of_closefork
int of_closefork(const AFPObj *obj, struct ofork *ofork)
Definition ofork.c:432
flushfork
int flushfork(struct ofork *)
Definition fork.c:1197
afp_openfork
int afp_openfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:285
afp_read_ext
int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1112
of_close_all_forks
void of_close_all_forks(const AFPObj *obj)
Definition ofork.c:579
obj
static AFPObj obj
Definition netatalk.c:62
AFPObj
Definition globals.h:158
adouble
Definition adouble.h:191
dir
Definition include/atalk/directory.h:55
file_key
Definition fork.h:17
file_key::dev
dev_t dev
Definition fork.h:18
file_key::inode
ino_t inode
Definition fork.h:19
ofork
Definition fork.h:22
ofork::key
struct file_key key
Definition fork.h:23
ofork::of_did
cnid_t of_did
Definition fork.h:26
ofork::of_vol
struct vol * of_vol
Definition fork.h:25
ofork::of_flags
int of_flags
Definition fork.h:28
ofork::prevp
struct ofork ** prevp
Definition fork.h:29
ofork::next
struct ofork * next
Definition fork.h:29
ofork::of_refnum
uint16_t of_refnum
Definition fork.h:27
ofork::of_ad
struct adouble * of_ad
Definition fork.h:24
path
Definition include/atalk/directory.h:82
vol
Definition include/atalk/volume.h:30