Go to the source code of this file.
Data Structures | |
struct | ccnr_handle |
We pass this handle almost everywhere within ccnr. More... | |
struct | content_queue |
struct | fdholder |
Each fdholder is referenced by its file descriptor. More... | |
struct | content_by_accession_entry |
The content_by_accession hash table, keyed by accession, holds entries that have a known accession. More... | |
struct | propagating_entry |
The propagating interest hash table is keyed by Nonce. More... | |
struct | nameprefix_entry |
The nameprefix hash table is keyed by the Component elements of the Name prefix. More... | |
struct | ccn_forwarding |
Keeps track of the faces that interests matching a given name prefix may be forwarded to. More... | |
struct | enum_state |
Defines | |
#define | CCNR_NULL_ACCESSION ((ccnr_accession)(0)) |
#define | CCNR_MIN_ACCESSION ((ccnr_accession)(1)) |
#define | CCNR_MAX_ACCESSION ((ccnr_accession)(~CCNR_NULL_ACCESSION)) |
#define | CCNR_NOT_COMPARABLE (-2) |
#define | CCNR_NULL_HWM ((ccnr_hwm)(0)) |
#define | CCNSHOULDLOG(h, who, level) (((h)->debug >= (level)) != 0) |
This is true if we should log at the given level. | |
#define | LM_2 2 |
#define | LM_4 4 |
#define | LM_8 8 |
#define | LM_16 16 |
#define | LM_32 32 |
#define | LM_64 64 |
#define | LM_128 128 |
#define | CCNR_MAX_ENUM 64 |
Limit on how many active sync enumerations we are willing to have going. | |
#define | CCNR_FACE_DGRAM (1 << 1) |
fdholder flags | |
#define | CCNR_FACE_GG (1 << 2) |
Considered friendly. | |
#define | CCNR_FACE_LOCAL (1 << 3) |
PF_UNIX socket. | |
#define | CCNR_FACE_INET (1 << 4) |
IPv4. | |
#define | CCNR_FACE_INET6 (1 << 6) |
IPv6. | |
#define | CCNR_FACE_NOSEND (1 << 8) |
Don't send anymore. | |
#define | CCNR_FACE_UNDECIDED (1 << 9) |
Might not be talking ccn. | |
#define | CCNR_FACE_PERMANENT (1 << 10) |
No timeout for inactivity. | |
#define | CCNR_FACE_CONNECTING (1 << 11) |
Connect in progress. | |
#define | CCNR_FACE_LOOPBACK (1 << 12) |
v4 or v6 loopback address | |
#define | CCNR_FACE_CLOSING (1 << 13) |
close stream when output is done | |
#define | CCNR_FACE_PASSIVE (1 << 14) |
a listener or a bound dgram socket | |
#define | CCNR_FACE_NORECV (1 << 15) |
use for sending only | |
#define | CCNR_FACE_REPODATA (1 << 19) |
#define | CCNR_FACE_CCND (1 << 20) |
#define | CCNR_FACE_SOCKMASK (CCNR_FACE_DGRAM | CCNR_FACE_INET | CCNR_FACE_INET6 | CCNR_FACE_LOCAL) |
#define | CCN_NOFACEID (-1) |
#define | CCN_CONTENT_ENTRY_SLOWSEND 1 |
content_entry flags | |
#define | CCN_CONTENT_ENTRY_STALE 2 |
#define | CCN_CONTENT_ENTRY_PRECIOUS 4 |
#define | CCN_CONTENT_ENTRY_STABLE 8 |
Repository-backed. | |
#define | CCN_PR_UNSENT 0x01 |
interest has not been sent anywhere yet | |
#define | CCN_PR_WAIT1 0x02 |
interest has been sent to one place | |
#define | CCN_PR_STUFFED1 0x04 |
was stuffed before sent anywhere else | |
#define | CCN_PR_TAP 0x08 |
at least one tap fdholder is present | |
#define | CCN_PR_EQV 0x10 |
a younger similar interest exists | |
#define | CCN_PR_SCOPE0 0x20 |
interest scope is 0 | |
#define | CCN_PR_SCOPE1 0x40 |
interest scope is 1 (this host) | |
#define | CCN_PR_SCOPE2 0x80 |
interest scope is 2 (immediate neighborhood) | |
#define | ENUM_N_COBS 9 |
#define | CCN_FORW_PFXO (CCN_FORW_ADVERTISE | CCN_FORW_CAPTURE | CCN_FORW_LOCAL) |
#define | CCN_FORW_REFRESHED (1 << 16) |
private to ccnr | |
#define | CCN_FWU_SECS 5 |
Determines how frequently we age our forwarding entries. | |
#define | CCNRID_LOCAL_URI "ccnx:/%C1.M.S.localhost/%C1.M.SRV/repository/KEY" |
URIs for prefixes served by the internal client. | |
#define | CCNRID_NEIGHBOR_URI "ccnx:/%C1.M.S.neighborhood/%C1.M.SRV/repository/KEY" |
#define | CCNRID_POLICY_URI "ccnx:/%C1.M.S.localhost/%C1.M.SRV/repository/POLICY" |
#define | PUBLIC |
Typedefs | |
typedef uint_least64_t | ccnr_accession |
typedef uintmax_t | ccnr_hwm |
typedef unsigned | ccnr_cookie |
A cookie is used as a more ephemeral way of holding a reference to a content object, without the danger of an undetected dangling reference when the in-memory content handle is destroyed. | |
typedef int(* | ccnr_logger )(void *loggerdata, const char *format, va_list ap) |
Logger type (ccnr_logger). | |
Enumerations | |
enum | cq_delay_class { CCN_CQ_ASAP, CCN_CQ_NORMAL, CCN_CQ_SLOW, CCN_CQ_N, CCN_CQ_ASAP, CCN_CQ_NORMAL, CCN_CQ_SLOW, CCN_CQ_N } |
enum | ccnr_face_meter_index { FM_BYTI, FM_BYTO, FM_DATI, FM_INTO, FM_DATO, FM_INTI, CCNR_FACE_METER_N } |
fdholder meter index More... | |
enum | es_active_state { ES_PENDING = -1, ES_INACTIVE = 0, ES_ACTIVE = 1 } |
Keeps track of the state of running and recently completed enumerations The enum_state hash table is keyed by the interest up to the segment id. More... | |
Functions | |
uintmax_t | ccnr_accession_encode (struct ccnr_handle *, ccnr_accession) |
ccnr_accession | ccnr_accession_decode (struct ccnr_handle *, uintmax_t) |
int | ccnr_accession_compare (struct ccnr_handle *ccnr, ccnr_accession x, ccnr_accession y) |
uintmax_t | ccnr_hwm_encode (struct ccnr_handle *, ccnr_hwm) |
ccnr_hwm | ccnr_hwm_decode (struct ccnr_handle *, uintmax_t) |
int | ccnr_acc_in_hwm (struct ccnr_handle *, ccnr_accession a, ccnr_hwm hwm) |
ccnr_hwm | ccnr_hwm_update (struct ccnr_handle *, ccnr_hwm, ccnr_accession) |
ccnr_hwm | ccnr_hwm_merge (struct ccnr_handle *, ccnr_hwm, ccnr_hwm) |
int | ccnr_hwm_compare (struct ccnr_handle *ccnr, ccnr_hwm x, ccnr_hwm y) |
struct ccnr_handle * | r_init_create (const char *, ccnr_logger, void *) |
Create a new ccnr instance. | |
void | r_init_run (struct ccnr_handle *h) |
void | r_init_destroy (struct ccnr_handle **) |
Destroy the ccnr instance, releasing all associated resources. |
Data structures are described here so that logging and status routines can be compiled separately.
Part of ccnr - the CCNx Repository Daemon.
Copyright (C) 2008-2011 Palo Alto Research Center, Inc.
This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Definition in file ccnr_private.h.
#define CCN_CONTENT_ENTRY_PRECIOUS 4 |
Definition at line 342 of file ccnr_private.h.
#define CCN_CONTENT_ENTRY_SLOWSEND 1 |
#define CCN_CONTENT_ENTRY_STABLE 8 |
Repository-backed.
Definition at line 343 of file ccnr_private.h.
Referenced by r_store_commit_content(), r_store_enroll_content(), r_store_set_accession_from_offset(), r_sync_local_store(), and r_sync_upcall_store().
#define CCN_CONTENT_ENTRY_STALE 2 |
Definition at line 341 of file ccnr_private.h.
#define CCN_FORW_PFXO (CCN_FORW_ADVERTISE | CCN_FORW_CAPTURE | CCN_FORW_LOCAL) |
Definition at line 448 of file ccnr_private.h.
#define CCN_FORW_REFRESHED (1 << 16) |
#define CCN_FWU_SECS 5 |
Determines how frequently we age our forwarding entries.
Definition at line 455 of file ccnr_private.h.
#define CCN_NOFACEID (-1) |
Definition at line 329 of file ccnr_private.h.
#define CCN_PR_EQV 0x10 |
#define CCN_PR_SCOPE0 0x20 |
#define CCN_PR_SCOPE1 0x40 |
#define CCN_PR_SCOPE2 0x80 |
#define CCN_PR_STUFFED1 0x04 |
#define CCN_PR_TAP 0x08 |
#define CCN_PR_UNSENT 0x01 |
#define CCN_PR_WAIT1 0x02 |
#define CCNR_FACE_CCND (1 << 20) |
Definition at line 326 of file ccnr_private.h.
Referenced by choose_face_delay(), r_dispatch_process_input(), r_init_create(), r_io_prepare_poll_fds(), r_io_send(), r_io_shutdown_client_fd(), and r_link_do_deferred_write().
#define CCNR_FACE_CLOSING (1 << 13) |
close stream when output is done
Definition at line 322 of file ccnr_private.h.
Referenced by ccnr_stats_handle_http_connection(), r_io_prepare_poll_fds(), and r_link_do_deferred_write().
#define CCNR_FACE_CONNECTING (1 << 11) |
Connect in progress.
Definition at line 320 of file ccnr_private.h.
Referenced by r_link_do_deferred_write().
#define CCNR_FACE_DGRAM (1 << 1) |
fdholder flags
Datagram interface, respect packets
Definition at line 312 of file ccnr_private.h.
Referenced by r_dispatch_process_input(), and r_io_send().
#define CCNR_FACE_GG (1 << 2) |
Considered friendly.
Definition at line 313 of file ccnr_private.h.
Referenced by init_face_flags(), process_input_message(), r_init_create(), and r_match_match_interests().
#define CCNR_FACE_INET (1 << 4) |
IPv4.
Definition at line 315 of file ccnr_private.h.
Referenced by init_face_flags(), post_face_notice(), and r_init_create().
#define CCNR_FACE_INET6 (1 << 6) |
IPv6.
Definition at line 316 of file ccnr_private.h.
Referenced by init_face_flags(), post_face_notice(), and r_init_create().
#define CCNR_FACE_LOCAL (1 << 3) |
PF_UNIX socket.
Definition at line 314 of file ccnr_private.h.
Referenced by init_face_flags(), r_dispatch_process_input(), and r_init_create().
#define CCNR_FACE_LOOPBACK (1 << 12) |
v4 or v6 loopback address
Definition at line 321 of file ccnr_private.h.
Referenced by init_face_flags(), and process_input_message().
#define CCNR_FACE_NORECV (1 << 15) |
use for sending only
Definition at line 324 of file ccnr_private.h.
Referenced by r_init_create(), r_io_open_repo_data_file(), and r_io_prepare_poll_fds().
#define CCNR_FACE_NOSEND (1 << 8) |
Don't send anymore.
Definition at line 317 of file ccnr_private.h.
Referenced by ccnr_stats_handle_http_connection(), content_sender(), handle_send_error(), r_io_open_repo_data_file(), r_io_send(), r_link_do_deferred_write(), r_link_send_content(), and r_sendq_face_send_queue_insert().
#define CCNR_FACE_PASSIVE (1 << 14) |
a listener or a bound dgram socket
Definition at line 323 of file ccnr_private.h.
Referenced by collect_face_meter_html(), collect_faces_html(), collect_faces_xml(), r_dispatch_process_input(), r_io_register_new_face(), r_net_listen_on_address(), and r_net_listen_on_wildcards().
#define CCNR_FACE_PERMANENT (1 << 10) |
#define CCNR_FACE_REPODATA (1 << 19) |
Definition at line 325 of file ccnr_private.h.
Referenced by choose_face_delay(), init_face_flags(), r_dispatch_process_input(), r_io_open_repo_data_file(), r_io_prepare_poll_fds(), and r_io_send().
#define CCNR_FACE_SOCKMASK (CCNR_FACE_DGRAM | CCNR_FACE_INET | CCNR_FACE_INET6 | CCNR_FACE_LOCAL) |
#define CCNR_FACE_UNDECIDED (1 << 9) |
Might not be talking ccn.
Definition at line 318 of file ccnr_private.h.
Referenced by collect_face_meter_html(), collect_faces_html(), collect_faces_xml(), process_input_message(), r_dispatch_process_input(), r_io_accept_connection(), and r_io_register_new_face().
#define CCNR_MAX_ACCESSION ((ccnr_accession)(~CCNR_NULL_ACCESSION)) |
Definition at line 92 of file ccnr_private.h.
Referenced by r_init_create(), r_sync_enumerate(), r_sync_notify_content(), and SyncAddName().
#define CCNR_MAX_ENUM 64 |
Limit on how many active sync enumerations we are willing to have going.
Definition at line 163 of file ccnr_private.h.
Referenced by cleanup_se(), r_sync_enumerate(), and r_sync_enumerate_action().
#define CCNR_MIN_ACCESSION ((ccnr_accession)(1)) |
#define CCNR_NOT_COMPARABLE (-2) |
Definition at line 95 of file ccnr_private.h.
Referenced by ccnr_accession_compare(), and ccnr_hwm_compare().
#define CCNR_NULL_ACCESSION ((ccnr_accession)(0)) |
Definition at line 90 of file ccnr_private.h.
Referenced by cleanup_se(), process_incoming_content(), r_store_content_base(), r_store_content_btree_insert(), r_store_content_from_accession(), r_store_content_trim(), r_store_enroll_content(), r_store_forget_content(), r_store_look(), r_store_lookup(), r_store_send_content(), r_store_set_accession_from_offset(), r_sync_enumerate(), r_sync_enumerate_action(), r_sync_notify_content(), SyncAddName(), and SyncNotifyContent().
#define CCNR_NULL_HWM ((ccnr_hwm)(0)) |
Definition at line 110 of file ccnr_private.h.
Referenced by SyncAddRoot(), SyncHashEnter(), SyncNewBase(), SyncStartHeartbeat(), and UpdateAction().
#define CCNRID_LOCAL_URI "ccnx:/%C1.M.S.localhost/%C1.M.SRV/repository/KEY" |
URIs for prefixes served by the internal client.
Definition at line 460 of file ccnr_private.h.
Referenced by ccnr_answer_req().
#define CCNRID_NEIGHBOR_URI "ccnx:/%C1.M.S.neighborhood/%C1.M.SRV/repository/KEY" |
#define CCNRID_POLICY_URI "ccnx:/%C1.M.S.localhost/%C1.M.SRV/repository/POLICY" |
#define CCNSHOULDLOG | ( | h, | |||
who, | |||||
level | ) | (((h)->debug >= (level)) != 0) |
This is true if we should log at the given level.
Definition at line 149 of file ccnr_private.h.
Referenced by ccnr_answer_req(), ccnr_close_fd(), ccnr_direct_client_refresh(), ccnr_init_repo_keystore(), cleanup_se(), content_sender(), establish_min_send_bufsize(), merge_files(), process_incoming_content(), r_init_config_msg(), r_init_confval(), r_init_parse_config(), r_io_accept_connection(), r_io_open_repo_data_file(), r_io_prepare_poll_fds(), r_io_send(), r_io_shutdown_client_fd(), r_link_do_deferred_write(), r_match_consume_matching_interests(), r_net_listen_on_address(), r_net_listen_on_wildcards(), r_proto_activate_policy(), r_proto_answer_req(), r_proto_begin_enumeration(), r_proto_bulk_import(), r_proto_check_exclude(), r_proto_continue_enumeration(), r_proto_deactivate_policy(), r_proto_expect_content(), r_proto_initiate_key_fetch(), r_proto_policy_complete(), r_proto_start_write(), r_proto_start_write_checked(), r_sendq_face_send_queue_insert(), r_store_content_base(), r_store_content_from_accession(), r_store_find_first_match_candidate(), r_store_forget_content(), r_store_index_cleaner(), r_store_index_needs_cleaning(), r_store_init(), r_store_lookup(), r_store_mark_stale(), r_store_next_child_at_level(), r_store_read_stable_point(), r_store_send_content(), r_store_trim(), r_store_write_stable_point(), r_sync_enumerate(), r_sync_enumerate_action(), r_sync_local_store(), r_sync_notify_content(), r_sync_upcall_store(), and reap_enumerations().
#define ENUM_N_COBS 9 |
Definition at line 424 of file ccnr_private.h.
Referenced by r_proto_begin_enumeration(), and r_proto_continue_enumeration().
#define LM_128 128 |
Definition at line 158 of file ccnr_private.h.
Referenced by ccnr_answer_req(), merge_files(), r_proto_answer_req(), r_proto_policy_complete(), r_proto_start_write(), and r_proto_start_write_checked().
#define LM_16 16 |
Definition at line 155 of file ccnr_private.h.
#define LM_2 2 |
Definition at line 152 of file ccnr_private.h.
#define LM_32 32 |
Definition at line 156 of file ccnr_private.h.
#define LM_4 4 |
Definition at line 153 of file ccnr_private.h.
Referenced by process_incoming_content(), r_store_forget_content(), r_store_mark_stale(), and r_store_send_content().
#define LM_64 64 |
Definition at line 157 of file ccnr_private.h.
#define LM_8 8 |
Definition at line 154 of file ccnr_private.h.
Referenced by content_sender(), r_proto_answer_req(), r_proto_begin_enumeration(), r_proto_check_exclude(), r_proto_continue_enumeration(), r_sendq_face_send_queue_insert(), r_store_find_first_match_candidate(), r_store_lookup(), r_store_next_child_at_level(), and reap_enumerations().
#define PUBLIC |
Definition at line 464 of file ccnr_private.h.
typedef uint_least64_t ccnr_accession |
Definition at line 62 of file ccnr_private.h.
typedef unsigned ccnr_cookie |
A cookie is used as a more ephemeral way of holding a reference to a content object, without the danger of an undetected dangling reference when the in-memory content handle is destroyed.
This is for internal data structures such as queues or enumeration states, but should not be stored in any long-term way. Use a ccnr_accession, content name, or digest for that.
Holding a cookie does not prevent the in-memory content handle from being destroyed, either explicitly or to conserve resources.
Definition at line 139 of file ccnr_private.h.
typedef uintmax_t ccnr_hwm |
Definition at line 109 of file ccnr_private.h.
typedef int(* ccnr_logger)(void *loggerdata, const char *format, va_list ap) |
enum cq_delay_class |
CCN_CQ_ASAP | |
CCN_CQ_NORMAL | |
CCN_CQ_SLOW | |
CCN_CQ_N | |
CCN_CQ_ASAP | |
CCN_CQ_NORMAL | |
CCN_CQ_SLOW | |
CCN_CQ_N |
Definition at line 272 of file ccnr_private.h.
enum es_active_state |
Keeps track of the state of running and recently completed enumerations The enum_state hash table is keyed by the interest up to the segment id.
Definition at line 419 of file ccnr_private.h.
int ccnr_acc_in_hwm | ( | struct ccnr_handle * | , | |
ccnr_accession | a, | |||
ccnr_hwm | hwm | |||
) |
Definition at line 89 of file ccnr_sync.c.
int ccnr_accession_compare | ( | struct ccnr_handle * | ccnr, | |
ccnr_accession | x, | |||
ccnr_accession | y | |||
) |
Definition at line 68 of file ccnr_sync.c.
ccnr_accession ccnr_accession_decode | ( | struct ccnr_handle * | , | |
uintmax_t | ||||
) |
Definition at line 62 of file ccnr_sync.c.
Referenced by r_store_content_btree_insert(), and r_store_look().
uintmax_t ccnr_accession_encode | ( | struct ccnr_handle * | , | |
ccnr_accession | ||||
) |
Definition at line 56 of file ccnr_sync.c.
Referenced by r_store_content_base(), r_store_content_btree_insert(), r_store_content_from_accession(), r_store_set_accession_from_offset(), r_sync_enumerate(), r_sync_notify_content(), and SyncAddName().
int ccnr_hwm_compare | ( | struct ccnr_handle * | ccnr, | |
ccnr_hwm | x, | |||
ccnr_hwm | y | |||
) |
ccnr_hwm ccnr_hwm_decode | ( | struct ccnr_handle * | , | |
uintmax_t | ||||
) |
uintmax_t ccnr_hwm_encode | ( | struct ccnr_handle * | , | |
ccnr_hwm | ||||
) |
Definition at line 77 of file ccnr_sync.c.
Referenced by HeartbeatAction(), storeStablePoint(), and UpdateAction().
ccnr_hwm ccnr_hwm_merge | ( | struct ccnr_handle * | , | |
ccnr_hwm | , | |||
ccnr_hwm | ||||
) |
Definition at line 101 of file ccnr_sync.c.
ccnr_hwm ccnr_hwm_update | ( | struct ccnr_handle * | , | |
ccnr_hwm | , | |||
ccnr_accession | ||||
) |
struct ccnr_handle* r_init_create | ( | const char * | progname, | |
ccnr_logger | logger, | |||
void * | loggerdata | |||
) | [read] |
Create a new ccnr instance.
progname | - name of program binary, used for locating helpers | |
logger | - logger function | |
loggerdata | - data to pass to logger function |
Definition at line 458 of file ccnr_init.c.
Referenced by main(), and start_ccnr().
void r_init_destroy | ( | struct ccnr_handle ** | ) |
Destroy the ccnr instance, releasing all associated resources.
Definition at line 618 of file ccnr_init.c.
Referenced by main(), r_init_create(), and start_ccnr().
void r_init_run | ( | struct ccnr_handle * | h | ) |