10 #include <sys/socket.h> 11 #include <sys/types.h> 58 struct sockaddr_storage clientaddr;
81 #define NBDS_ERR g_quark_from_static_string("server-error-quark") 115 #define msg(prio, ...) syslog(prio, __VA_ARGS__) 117 #define msg(prio, ...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __VA_ARGS__) 119 #define MY_NAME "nbd_server" The (required) group "generic" is missing.
uint8_t getmaskbyte(int masklen) G_GNUC_PURE
Gets a byte to allow for address masking.
gchar * servename
name of the export as selected by nbd-client
GArray * export
array of FILE_INFO of exported files; array size is always 1 unless we're doing the multiple file opt...
Variables associated with a server.
uint32_t difffilelen
number of pages in difffile
SERVER * server
The server this client is getting data from.
Failed to set SO_LINGER to a socket.
gchar * postrun
command that will be ran after the client disconnects
int clientfeats
Features supported by this client.
NBDS_ERRS
NBD server error codes.
Failed to bind an address to socket.
Error occurred during readdir()
The configuration file is not found.
gchar * cowdir
directory for copy-on-write diff files.
int flags
flags associated with this exported file
Failed to start listening on a socket.
A (required) key is missing.
gchar * exportname
(unprocessed) filename of the file we're exporting
int net
The actual client socket.
int authorized_client(CLIENT *opts)
Check whether a client is allowed to connect.
Underlying system call or library error.
unsigned int port
port we're exporting this file at
gchar * transactionlog
filename for transaction log
Every subnet in its own directory.
gchar * listenaddr
The IP address we're listening on.
Failed to set SO_KEEPALIVE to a socket.
char * clientname
peer, in human-readable format
int append_serve(const SERVER *const s, GArray *const a)
append new server to array
int socket
The socket of this server.
Variables associated with a client connection.
int difffile
filedescriptor of copyonwrite file.
bool address_matches(const char *mask, const struct sockaddr *addr, GError **err)
Check whether a given address matches a given netmask.
Failed to get address info.
uint32_t * difmap
see comment on the global difmap for this one
VIRT_STYLE
Types of virtuatlization.
Literal IP address as part of the filename.
int transactionlogfd
fd for transaction log
The reserved port was specified for an old-style export.
int max_connections
maximum number of opened connections
VIRT_STYLE virtstyle
The style of virtualization, if any.
Failed to set SO_REUSEADDR to a socket.
int socket_family
family of the socket
uint64_t expected_size
size of the exported file as it was told to us through configuration
gchar * prerun
command to be ran after connecting a client, but before starting to serve
uint64_t exportsize
size of the file we're exporting
SERVER * dup_serve(const SERVER *const s)
duplicate server
char * authname
filename of the authorization file
uint64_t size_autodetect(int fhandle)
Detect the size of a file.
gboolean modern
client was negotiated using modern negotiation protocol
A config file was specified that does not define any exports.
char * difffilename
filename of the copy-on-write file, if any
Replacing all dots in an ip address by a / before doing the same as in IPLIT.
uint8_t cidrlen
The length of the mask when we use CIDR-style virtualization.
A value is not supported in this build.
A directory requested does not exist.
char * exportname
(processed) filename of the file we're exporting
A value is syntactically invalid.
Failed to create a socket.