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
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 const unsigned char *of_virtual_data;
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
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:293
int of_flush(const struct vol *)
Definition ofork.c:93
void of_dealloc(struct ofork *)
Definition ofork.c:433
struct ofork * of_findname(const struct vol *vol, struct path *)
Definition ofork.c:374
struct ofork * of_find(const uint16_t)
Definition ofork.c:269
int afp_closefork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1746
int of_statdir(struct vol *vol, struct path *)
stat the current directory.
Definition ofork.c:326
struct ofork * of_findnameat(int dirfd, struct path *path)
Search for open fork by dirfd/name.
Definition ofork.c:408
int afp_bytelock(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1119
int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:826
void of_pforkdesc(FILE *)
Definition ofork.c:78
void of_closevol(const AFPObj *obj, const struct vol *vol)
Definition ofork.c:707
struct ofork * of_alloc(struct vol *, struct dir *, char *, uint16_t *, const int, struct adouble *, struct stat *)
Definition ofork.c:154
int afp_flush(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1618
int afp_flushfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1635
struct adouble * of_ad(const struct vol *, struct path *, struct adouble *)
Definition ofork.c:688
int of_rename(const struct vol *, struct ofork *, struct dir *, const char *, struct dir *, const char *)
Definition ofork.c:111
int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:2104
int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:2097
int of_fstatat(int dirfd, struct path *path)
Definition ofork.c:308
int afp_syncfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1669
int afp_read(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1604
int afp_write(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:2088
int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1126
int of_closefork(const AFPObj *obj, struct ofork *ofork)
Definition ofork.c:453
int flushfork(struct ofork *)
Definition fork.c:1700
int afp_openfork(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:406
int afp_read_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition fork.c:1611
void of_close_all_forks(const AFPObj *obj)
Definition ofork.c:729
static AFPObj obj
Definition netatalk.c:69
Definition globals.h:166
Definition adouble.h:191
Definition include/atalk/directory.h:56
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
const unsigned char * of_virtual_data
Definition fork.h:29
struct ofork ** prevp
Definition fork.h:31
struct ofork * next
Definition fork.h:31
uint16_t of_refnum
Definition fork.h:27
struct adouble * of_ad
Definition fork.h:24
off_t of_virtual_len
Definition fork.h:30
Definition include/atalk/directory.h:123
Definition include/atalk/volume.h:33