Part of ccnr - CCNx Repository Daemon. More...
Go to the source code of this file.
Functions | |
| PUBLIC struct fdholder * | r_io_fdholder_from_fd (struct ccnr_handle *h, unsigned filedesc) |
| Looks up a fdholder based on its filedesc (private). | |
| PUBLIC struct fdholder * | ccnr_r_io_fdholder_from_fd (struct ccnr_handle *h, unsigned filedesc) |
| Looks up a fdholder based on its filedesc. | |
| PUBLIC 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. | |
| static void | close_fd (int *pfd) |
| Close an open file descriptor quietly. | |
| void | ccnr_close_fd (struct ccnr_handle *h, unsigned filedesc, int *pfd) |
| Close an open file descriptor, and grumble about it. | |
| static void | init_face_flags (struct ccnr_handle *h, struct fdholder *fdholder, int setflags) |
| Initialize the fdholder flags based upon the addr information and the provided explicit setflags. | |
| PUBLIC struct fdholder * | r_io_record_fd (struct ccnr_handle *h, int fd, void *who, socklen_t wholen, int setflags) |
| Make a new fdholder corresponding to the fd. | |
| PUBLIC int | r_io_accept_connection (struct ccnr_handle *h, int listener_fd) |
| Accept an incoming DGRAM_STREAM connection, creating a new fdholder. | |
| PUBLIC int | r_io_open_repo_data_file (struct ccnr_handle *h, const char *name, int output) |
| PUBLIC int | r_io_repo_data_file_fd (struct ccnr_handle *h, unsigned repofile, int output) |
| PUBLIC void | r_io_shutdown_client_fd (struct ccnr_handle *h, int fd) |
| PUBLIC int | r_io_destroy_face (struct ccnr_handle *h, unsigned filedesc) |
| Destroys the fdholder identified by filedesc. | |
| PUBLIC 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. | |
| static int | handle_send_error (struct ccnr_handle *h, int errnum, struct fdholder *fdholder, const void *data, size_t size) |
| Handle errors after send() or sendto(). | |
| static int | sending_fd (struct ccnr_handle *h, struct fdholder *fdholder) |
| PUBLIC 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. | |
| PUBLIC void | r_io_prepare_poll_fds (struct ccnr_handle *h) |
| Set up the array of fd descriptors for the poll(2) call. | |
| PUBLIC void | r_io_shutdown_all (struct ccnr_handle *h) |
| Shutdown all open fds. | |
Part of ccnr - CCNx Repository Daemon.
Definition in file ccnr_io.c.
| void ccnr_close_fd | ( | struct ccnr_handle * | h, | |
| unsigned | filedesc, | |||
| int * | pfd | |||
| ) |
| PUBLIC 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().
| static void close_fd | ( | int * | pfd | ) | [static] |
Close an open file descriptor quietly.
Definition at line 134 of file ccnr_io.c.
Referenced by r_io_accept_connection(), and r_io_open_repo_data_file().
| static int handle_send_error | ( | struct ccnr_handle * | h, | |
| int | errnum, | |||
| struct fdholder * | fdholder, | |||
| const void * | data, | |||
| size_t | size | |||
| ) | [static] |
Handle errors after send() or sendto().
Definition at line 392 of file ccnr_io.c.
Referenced by r_io_send().
| static void init_face_flags | ( | struct ccnr_handle * | h, | |
| struct fdholder * | fdholder, | |||
| int | setflags | |||
| ) | [static] |
Initialize the fdholder flags based upon the addr information and the provided explicit setflags.
Definition at line 170 of file ccnr_io.c.
Referenced by r_io_record_fd().
| PUBLIC int r_io_accept_connection | ( | struct ccnr_handle * | h, | |
| int | listener_fd | |||
| ) |
Accept an incoming DGRAM_STREAM connection, creating a new fdholder.
Definition at line 250 of file ccnr_io.c.
Referenced by r_dispatch_process_input().
| PUBLIC int r_io_destroy_face | ( | struct ccnr_handle * | h, | |
| unsigned | filedesc | |||
| ) |
Destroys the fdholder identified by filedesc.
Definition at line 369 of file ccnr_io.c.
Referenced by ccnr_stats_handle_http_connection().
| PUBLIC 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().
| PUBLIC struct fdholder* r_io_fdholder_from_fd | ( | struct ccnr_handle * | h, | |
| unsigned | filedesc | |||
| ) | [read] |
Looks up a fdholder based on its filedesc (private).
Definition at line 70 of file ccnr_io.c.
Referenced by ccnr_r_io_fdholder_from_fd(), content_sender(), r_dispatch_process_input(), r_init_map_and_process_file(), r_io_prepare_poll_fds(), r_io_shutdown_all(), r_io_shutdown_client_fd(), r_link_do_deferred_write(), r_match_consume_interest(), r_match_consume_matching_interests(), r_proto_answer_req(), r_proto_expect_content(), r_store_commit_content(), r_store_reindexing(), r_store_send_content(), r_sync_local_store(), and r_sync_upcall_store().
| PUBLIC 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().
| PUBLIC 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().
| PUBLIC 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().
| PUBLIC 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().
| PUBLIC 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().
| PUBLIC 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().
| PUBLIC void r_io_shutdown_all | ( | struct ccnr_handle * | h | ) |
| PUBLIC void r_io_shutdown_client_fd | ( | struct ccnr_handle * | h, | |
| int | fd | |||
| ) |
Definition at line 325 of file ccnr_io.c.
Referenced by r_dispatch_process_input(), r_dispatch_run(), r_init_map_and_process_file(), r_io_destroy_face(), r_io_shutdown_all(), and r_link_do_deferred_write().
| static int sending_fd | ( | struct ccnr_handle * | h, | |
| struct fdholder * | fdholder | |||
| ) | [static] |
Definition at line 414 of file ccnr_io.c.
Referenced by r_io_send().
1.6.3