Network Block Device  @PACKAGE_VERSION@
Functions | Variables
cliserv.c File Reference
#include <config.h>
#include <stdio.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <cliserv.h>
#include <nbd-debug.h>

Go to the source code of this file.

Functions

void setmysockopt (int sock)
 
void err_nonfatal (const char *s)
 
void err (const char *s)
 
void logging (const char *name)
 
uint64_t ntohll (uint64_t a)
 
void readit (int f, void *buf, size_t len)
 Read data from a file descriptor into a buffer. More...
 

Variables

const u64 cliserv_magic = 0x00420281861253LL
 
const u64 opts_magic = 0x49484156454F5054LL
 
const u64 rep_magic = 0x3e889045565a9LL
 

Function Documentation

void err ( const char *  s)
void err_nonfatal ( const char *  s)

Definition at line 33 of file cliserv.c.

Referenced by err(), handle_list(), negotiate(), opennet(), openunix(), and socket_accept().

void logging ( const char *  name)

Definition at line 64 of file cliserv.c.

Referenced by main().

uint64_t ntohll ( uint64_t  a)

Definition at line 78 of file cliserv.c.

Referenced by ask_list(), main(), mainloop(), mainloop_threaded(), and negotiate().

void readit ( int  f,
void *  buf,
size_t  len 
)

Read data from a file descriptor into a buffer.

Parameters
fa file descriptor
bufa buffer
lenthe number of bytes to be read

Definition at line 95 of file cliserv.c.

References DEBUG, and err().

Referenced by consume(), mainloop(), mainloop_threaded(), and negotiate().

void setmysockopt ( int  sock)

Definition at line 15 of file cliserv.c.

References INFO.

Referenced by opennet(), and serveconnection().

Variable Documentation

const u64 cliserv_magic = 0x00420281861253LL

Definition at line 11 of file cliserv.c.

Referenced by negotiate().

const u64 opts_magic = 0x49484156454F5054LL

Definition at line 12 of file cliserv.c.

Referenced by ask_list(), and negotiate().

const u64 rep_magic = 0x3e889045565a9LL

Definition at line 13 of file cliserv.c.

Referenced by ask_list().