netatalk: fork.h Source File

netatalk 4.5.0
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 const unsigned char *of_virtual_data;
30 off_t of_virtual_len;
31 struct ofork **prevp, *next;
32};
33
34#define OPENFORK_DATA (0)
35#define OPENFORK_RSCS (1<<7)
36
37#define OPENACC_RD (1<<0)
38#define OPENACC_WR (1<<1)
39#define OPENACC_DRD (1<<4)
40#define OPENACC_DWR (1<<5)
41
42/* ofork.of_flags bits */
43#define AFPFORK_DATA (1<<0)
44#define AFPFORK_RSRC (1<<1)
45#define AFPFORK_META (1<<2)
46#define AFPFORK_DIRTY (1<<3)
47#define AFPFORK_ACCRD (1<<4)
48#define AFPFORK_ACCWR (1<<5)
49#define AFPFORK_ACCMASK (AFPFORK_ACCRD | AFPFORK_ACCWR)
50#define AFPFORK_MODIFIED (1<<6)
51#define AFPFORK_ERROR (1<<7)
52#define AFPFORK_VIRTUAL (1<<8)
53
54#define of_name(a) (a)->of_ad->ad_name
55/* in ofork.c */
56extern struct ofork *of_alloc(struct vol *, struct dir *,
57 char *, uint16_t *, const int,
58 struct adouble *,
59 struct stat *);
60extern void of_dealloc(struct ofork *);
61extern struct ofork *of_find(const uint16_t);
62extern struct ofork *of_findname(const struct vol *vol, struct path *);
63extern int of_rename(const struct vol *,
64 struct ofork *,
65 struct dir *, const char *,
66 struct dir *, const char *);
67extern int of_flush(const struct vol *);
68extern void of_pforkdesc(FILE *);
69extern int of_stat(const struct vol *vol, struct path *);
70extern int of_statdir(struct vol *vol, struct path *);
71extern int of_closefork(const AFPObj *obj, struct ofork *ofork);
72extern void of_closevol(const AFPObj *obj, const struct vol *vol);
73extern void of_close_all_forks(const AFPObj *obj);
74extern struct adouble *of_ad(const struct vol *, struct path *,
75 struct adouble *);
76extern struct ofork *of_findnameat(int dirfd, struct path *path);
77extern int of_fstatat(int dirfd, struct path *path);
78
79
80/* in fork.c */
81extern int flushfork(struct ofork *);
82
83/* FP functions */
84int afp_openfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
85 size_t *rbuflen);
86int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
87 size_t *rbuflen);
88int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
89 size_t *rbuflen);
90int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
91 size_t *rbuflen);
92int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
93 size_t *rbuflen);
94int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
95 size_t *rbuflen);
96int afp_flushfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
97 size_t *rbuflen);
98int afp_flush(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
99 size_t *rbuflen);
100int afp_closefork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
101 size_t *rbuflen);
102
103int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
104 size_t *rbuflen);
105int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
106 size_t *rbuflen);
107int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
108 size_t *rbuflen);
109int afp_syncfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
110 size_t *rbuflen);
111#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:293
of_flush
int of_flush(const struct vol *)
Definition ofork.c:93
of_dealloc
void of_dealloc(struct ofork *)
Definition ofork.c:433
of_findname
struct ofork * of_findname(const struct vol *vol, struct path *)
Definition ofork.c:374
of_find
struct ofork * of_find(const uint16_t)
Definition ofork.c:269
afp_closefork
int afp_closefork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1746
of_statdir
int of_statdir(struct vol *vol, struct path *)
stat the current directory.
Definition ofork.c:326
of_findnameat
struct ofork * of_findnameat(int dirfd, struct path *path)
Search for open fork by dirfd/name.
Definition ofork.c:408
afp_bytelock
int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1119
afp_setforkparams
int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:826
of_pforkdesc
void of_pforkdesc(FILE *)
Definition ofork.c:78
of_closevol
void of_closevol(const AFPObj *obj, const struct vol *vol)
Definition ofork.c:707
of_alloc
struct ofork * of_alloc(struct vol *, struct dir *, char *, uint16_t *, const int, struct adouble *, struct stat *)
Definition ofork.c:154
afp_flush
int afp_flush(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1618
afp_flushfork
int afp_flushfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1635
of_ad
struct adouble * of_ad(const struct vol *, struct path *, struct adouble *)
Definition ofork.c:688
of_rename
int of_rename(const struct vol *, struct ofork *, struct dir *, const char *, struct dir *, const char *)
Definition ofork.c:111
afp_getforkparams
int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:2104
afp_write_ext
int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:2097
of_fstatat
int of_fstatat(int dirfd, struct path *path)
Definition ofork.c:308
afp_syncfork
int afp_syncfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1669
afp_read
int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1604
afp_write
int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:2088
afp_bytelock_ext
int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1126
of_closefork
int of_closefork(const AFPObj *obj, struct ofork *ofork)
Definition ofork.c:453
flushfork
int flushfork(struct ofork *)
Definition fork.c:1700
afp_openfork
int afp_openfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:406
afp_read_ext
int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1611
of_close_all_forks
void of_close_all_forks(const AFPObj *obj)
Definition ofork.c:729
obj
static AFPObj obj
Definition netatalk.c:69
AFPObj
Definition globals.h:166
adouble
Definition adouble.h:191
dir
Definition include/atalk/directory.h:56
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::of_virtual_data
const unsigned char * of_virtual_data
Definition fork.h:29
ofork::prevp
struct ofork ** prevp
Definition fork.h:31
ofork::next
struct ofork * next
Definition fork.h:31
ofork::of_refnum
uint16_t of_refnum
Definition fork.h:27
ofork::of_ad
struct adouble * of_ad
Definition fork.h:24
ofork::of_virtual_len
off_t of_virtual_len
Definition fork.h:30
path
Definition include/atalk/directory.h:123
vol
Definition include/atalk/volume.h:33