summaryrefslogtreecommitdiffstats
path: root/support/export/export.h
blob: e2009ccdc44362e8e4334f486ec1cacb0ce583ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright (C) 2021 Red Hat <nfs@redhat.com>
 *
 * support/export/export.h
 *
 * Declarations for export support
 */

#ifndef EXPORT_H
#define EXPORT_H

#include "nfslib.h"
#include "exportfs.h"

unsigned int	auth_reload(void);
nfs_export *	auth_authenticate(const char *what,
					const struct sockaddr *caller,
					const char *path);

void		cache_open(void);
void		cache_set_fds(fd_set *fdset);
int		cache_process_req(fd_set *readfds);
void		cache_process_loop(void);

void		v4clients_init(void);
void		v4clients_set_fds(fd_set *fdset);
int		v4clients_process(fd_set *fdset);

struct nfs_fh_len *
		cache_get_filehandle(nfs_export *exp, int len, char *p);
int		cache_export(nfs_export *exp, char *path);
int		cache_fork_workers(char *prog, int num_threads);
void		cache_wait_for_workers(char *prog);
int		cache_process(fd_set *readfds);

bool ipaddr_client_matches(nfs_export *exp, struct addrinfo *ai);
bool namelist_client_matches(nfs_export *exp, char *dom);
bool client_matches(nfs_export *exp, char *dom, struct addrinfo *ai);

static inline bool is_ipaddr_client(char *dom)
{
	return dom[0] == '$';
}
#endif /* EXPORT__H */