ccnr_io.h File Reference

Part of ccnr - CCNx Repository Daemon. More...

Go to the source code of this file.

Functions

void r_io_shutdown_all (struct ccnr_handle *h)
 Shutdown all open fds.
void r_io_prepare_poll_fds (struct ccnr_handle *h)
 Set up the array of fd descriptors for the poll(2) call.
void r_dispatch_process_internal_client_buffer (struct ccnr_handle *h)
void r_io_send (struct ccnr_handle *h, struct fdholder *fdholder, const void *data, size_t size, off_t *offsetp)
 Send data to the fdholder.
int r_io_destroy_face (struct ccnr_handle *h, unsigned filedesc)
 Destroys the fdholder identified by filedesc.
int r_io_open_repo_data_file (struct ccnr_handle *h, const char *name, int output)
int r_io_repo_data_file_fd (struct ccnr_handle *h, unsigned repofile, int output)
void r_io_shutdown_client_fd (struct ccnr_handle *h, int fd)
int r_io_accept_connection (struct ccnr_handle *h, int listener_fd)
 Accept an incoming DGRAM_STREAM connection, creating a new fdholder.
struct fdholderr_io_record_fd (struct ccnr_handle *h, int fd, void *who, socklen_t wholen, int setflags)
 Make a new fdholder corresponding to the fd.
void r_io_register_new_face (struct ccnr_handle *h, struct fdholder *fdholder)
 Called when a fdholder is first created, and (perhaps) a second time in the case that a fdholder transitions from the undecided state.
int r_io_enroll_face (struct ccnr_handle *h, struct fdholder *fdholder)
 Assigns the filedesc for a nacent fdholder, calls r_io_register_new_face() if successful.
struct fdholderccnr_r_io_fdholder_from_fd (struct ccnr_handle *h, unsigned filedesc)
 Looks up a fdholder based on its filedesc.
struct fdholderr_io_fdholder_from_fd (struct ccnr_handle *h, unsigned filedesc)
 Looks up a fdholder based on its filedesc (private).


Detailed Description

Part of ccnr - CCNx Repository Daemon.

Definition in file ccnr_io.h.


Function Documentation

struct fdholder* ccnr_r_io_fdholder_from_fd ( struct ccnr_handle h,
unsigned  filedesc 
) [read]

Looks up a fdholder based on its filedesc.

Definition at line 86 of file ccnr_io.c.

Referenced by ccnr_collect_stats(), and post_face_notice().

void r_dispatch_process_internal_client_buffer ( struct ccnr_handle h  ) 

Definition at line 276 of file ccnr_dispatch.c.

Referenced by r_dispatch_run(), and r_io_send().

int r_io_accept_connection ( struct ccnr_handle h,
int  listener_fd 
)

Accept an incoming DGRAM_STREAM connection, creating a new fdholder.

Returns:
fd of new socket, or -1 for an error.

Definition at line 250 of file ccnr_io.c.

Referenced by r_dispatch_process_input().

int r_io_destroy_face ( struct ccnr_handle h,
unsigned  filedesc 
)

Destroys the fdholder identified by filedesc.

Returns:
0 for success, -1 for failure.

Definition at line 369 of file ccnr_io.c.

Referenced by ccnr_stats_handle_http_connection().

int r_io_enroll_face ( struct ccnr_handle h,
struct fdholder fdholder 
)

Assigns the filedesc for a nacent fdholder, calls r_io_register_new_face() if successful.

Definition at line 96 of file ccnr_io.c.

Referenced by r_init_create(), and r_io_record_fd().

struct fdholder* r_io_fdholder_from_fd ( struct ccnr_handle h,
unsigned  filedesc 
) [read]

int r_io_open_repo_data_file ( struct ccnr_handle h,
const char *  name,
int  output 
)

Definition at line 273 of file ccnr_io.c.

Referenced by r_init_map_and_process_file(), r_io_repo_data_file_fd(), and r_store_init().

void r_io_prepare_poll_fds ( struct ccnr_handle h  ) 

Set up the array of fd descriptors for the poll(2) call.

Definition at line 506 of file ccnr_io.c.

Referenced by r_dispatch_run().

struct fdholder* r_io_record_fd ( struct ccnr_handle h,
int  fd,
void *  who,
socklen_t  wholen,
int  setflags 
) [read]

Make a new fdholder corresponding to the fd.

Definition at line 214 of file ccnr_io.c.

Referenced by r_init_create(), r_io_accept_connection(), r_io_open_repo_data_file(), r_net_listen_on_address(), and r_net_listen_on_wildcards().

void r_io_register_new_face ( struct ccnr_handle h,
struct fdholder fdholder 
)

Called when a fdholder is first created, and (perhaps) a second time in the case that a fdholder transitions from the undecided state.

Definition at line 380 of file ccnr_io.c.

Referenced by process_input_message(), and r_io_enroll_face().

int r_io_repo_data_file_fd ( struct ccnr_handle h,
unsigned  repofile,
int  output 
)

Definition at line 312 of file ccnr_io.c.

Referenced by r_store_content_read().

void r_io_send ( struct ccnr_handle h,
struct fdholder fdholder,
const void *  data,
size_t  size,
off_t *  offsetp 
)

Send data to the fdholder.

No direct error result is provided; the fdholder state is updated as needed.

Definition at line 425 of file ccnr_io.c.

Referenced by ccnr_stats_handle_http_connection(), r_io_send(), r_link_stuff_and_send(), and send_http_response().

void r_io_shutdown_all ( struct ccnr_handle h  ) 

Shutdown all open fds.

Definition at line 546 of file ccnr_io.c.

Referenced by r_init_destroy().

void r_io_shutdown_client_fd ( struct ccnr_handle h,
int  fd 
)


Generated on Thu Feb 16 00:44:05 2012 for Content-Centric Networking in C by  doxygen 1.5.6