netatalk  4.4.0dev
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
17struct file_key {
18 dev_t dev;
19 ino_t inode;
20};
21
22struct ofork {
23 struct file_key key;
24 struct adouble *of_ad;
25 struct vol *of_vol;
27 uint16_t of_refnum;
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) /* open datafork */
42#define AFPFORK_RSRC (1<<1) /* open rsrcfork */
43#define AFPFORK_META (1<<2) /* open metadata */
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) /* used in FCE for modified files */
49#define AFPFORK_ERROR (1<<7) /* used to indicate an error in opening the fork */
50
51#define of_name(a) (a)->of_ad->ad_name
52/* in ofork.c */
53extern struct ofork *of_alloc(struct vol *, struct dir *,
54 char *, uint16_t *, const int,
55 struct adouble *,
56 struct stat *);
57extern void of_dealloc(struct ofork *);
58extern struct ofork *of_find(const uint16_t);
59extern struct ofork *of_findname(const struct vol *vol, struct path *);
60extern int of_rename(const struct vol *,
61 struct ofork *,
62 struct dir *, const char *,
63 struct dir *, const char *);
64extern int of_flush(const struct vol *);
65extern void of_pforkdesc(FILE *);
66extern int of_stat(const struct vol *vol, struct path *);
67extern int of_statdir(struct vol *vol, struct path *);
68extern int of_closefork(const AFPObj *obj, struct ofork *ofork);
69extern void of_closevol(const AFPObj *obj, const struct vol *vol);
70extern void of_close_all_forks(const AFPObj *obj);
71extern struct adouble *of_ad(const struct vol *, struct path *,
72 struct adouble *);
73extern struct ofork *of_findnameat(int dirfd, struct path *path);
74extern int of_fstatat(int dirfd, struct path *path);
75
76
77/* in fork.c */
78extern int flushfork(struct ofork *);
79
80/* FP functions */
81int afp_openfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
82 size_t *rbuflen);
83int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
84 size_t *rbuflen);
85int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
86 size_t *rbuflen);
87int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
88 size_t *rbuflen);
89int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
90 size_t *rbuflen);
91int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
92 size_t *rbuflen);
93int afp_flushfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
94 size_t *rbuflen);
95int afp_flush(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
96 size_t *rbuflen);
97int afp_closefork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
98 size_t *rbuflen);
99
100int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
101 size_t *rbuflen);
102int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
103 size_t *rbuflen);
104int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
105 size_t *rbuflen);
106int afp_syncfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,
107 size_t *rbuflen);
108#endif
Part of Netatalk's AppleDouble implementatation.
uint32_t cnid_t
Definition adouble.h:156
static size_t rbuflen
Definition afpfunc_helpers.c:45
static char rbuf[rbufsize]
Definition afpfunc_helpers.c:44
int of_stat(const struct vol *vol, struct path *)
Definition ofork.c:272
int of_flush(const struct vol *)
Definition ofork.c:86
void of_dealloc(struct ofork *)
Definition ofork.c:412
struct ofork * of_findname(const struct vol *vol, struct path *)
Definition ofork.c:353
struct ofork * of_find(const uint16_t)
Definition ofork.c:262
int afp_closefork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int of_statdir(struct vol *vol, struct path *)
Definition ofork.c:305
struct ofork * of_findnameat(int dirfd, struct path *path)
Search for open fork by dirfd/name.
Definition ofork.c:387
int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:840
int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
void of_pforkdesc(FILE *)
Definition ofork.c:71
void of_closevol(const AFPObj *obj, const struct vol *vol)
Definition ofork.c:560
struct ofork * of_alloc(struct vol *, struct dir *, char *, uint16_t *, const int, struct adouble *, struct stat *)
Definition ofork.c:147
int afp_flush(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int afp_flushfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
struct adouble * of_ad(const struct vol *, struct path *, struct adouble *)
Definition ofork.c:541
int of_rename(const struct vol *, struct ofork *, struct dir *, const char *, struct dir *, const char *)
int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1571
int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1564
int of_fstatat(int dirfd, struct path *path)
Definition ofork.c:287
int afp_syncfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1104
int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1555
int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:847
int of_closefork(const AFPObj *obj, struct ofork *ofork)
Definition ofork.c:432
int flushfork(struct ofork *)
Definition fork.c:1196
int afp_openfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1111
void of_close_all_forks(const AFPObj *obj)
Definition ofork.c:582
static AFPObj obj
Definition netatalk.c:62
Definition globals.h:154
Definition adouble.h:191
Definition include/atalk/directory.h:62
Definition fork.h:17
dev_t dev
Definition fork.h:18
ino_t inode
Definition fork.h:19
Definition fork.h:22
struct file_key key
Definition fork.h:23
cnid_t of_did
Definition fork.h:26
struct vol * of_vol
Definition fork.h:25
int of_flags
Definition fork.h:28
struct ofork ** prevp
Definition fork.h:29
struct ofork * next
Definition fork.h:29
uint16_t of_refnum
Definition fork.h:27
struct adouble * of_ad
Definition fork.h:24
Definition include/atalk/directory.h:97
Definition include/atalk/volume.h:32