ccnr_private.h File Reference

Private definitions for ccnr - the CCNx daemon. More...

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_handler_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.


Detailed Description

Private definitions for ccnr - the CCNx daemon.

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 Documentation

#define CCN_CONTENT_ENTRY_PRECIOUS   4

Definition at line 342 of file ccnr_private.h.

#define CCN_CONTENT_ENTRY_SLOWSEND   1

content_entry flags

Definition at line 340 of file ccnr_private.h.

#define CCN_CONTENT_ENTRY_STABLE   8

#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)

private to ccnr

Definition at line 449 of file ccnr_private.h.

#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

a younger similar interest exists

Definition at line 381 of file ccnr_private.h.

#define CCN_PR_SCOPE0   0x20

interest scope is 0

Definition at line 382 of file ccnr_private.h.

#define CCN_PR_SCOPE1   0x40

interest scope is 1 (this host)

Definition at line 383 of file ccnr_private.h.

#define CCN_PR_SCOPE2   0x80

interest scope is 2 (immediate neighborhood)

Definition at line 384 of file ccnr_private.h.

#define CCN_PR_STUFFED1   0x04

was stuffed before sent anywhere else

Definition at line 379 of file ccnr_private.h.

#define CCN_PR_TAP   0x08

at least one tap fdholder is present

Definition at line 380 of file ccnr_private.h.

#define CCN_PR_UNSENT   0x01

interest has not been sent anywhere yet

Definition at line 377 of file ccnr_private.h.

#define CCN_PR_WAIT1   0x02

interest has been sent to one place

Definition at line 378 of file ccnr_private.h.

#define CCNR_FACE_CCND   (1 << 20)

#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)

#define CCNR_FACE_PASSIVE   (1 << 14)

#define CCNR_FACE_PERMANENT   (1 << 10)

No timeout for inactivity.

Definition at line 319 of file ccnr_private.h.

#define CCNR_FACE_REPODATA   (1 << 19)

#define CCNR_FACE_SOCKMASK   (CCNR_FACE_DGRAM | CCNR_FACE_INET | CCNR_FACE_INET6 | CCNR_FACE_LOCAL)

Definition at line 327 of file ccnr_private.h.

Referenced by r_dispatch_process_input().

#define CCNR_FACE_UNDECIDED   (1 << 9)

#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))

Definition at line 91 of file ccnr_private.h.

Referenced by SyncAddName().

#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))

#define CCNR_NULL_HWM   ((ccnr_hwm)(0))

#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"

Definition at line 461 of file ccnr_private.h.

Referenced by ccnr_answer_req().

#define CCNRID_POLICY_URI   "ccnx:/%C1.M.S.localhost/%C1.M.SRV/repository/POLICY"

Definition at line 462 of file ccnr_private.h.

Referenced by ccnr_init_policy_link_cob().

#define CCNSHOULDLOG ( h,
who,
level   )     (((h)->debug >= (level)) != 0)

#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

#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

#define LM_64   64

Definition at line 157 of file ccnr_private.h.

#define LM_8   8

#define PUBLIC

Definition at line 464 of file ccnr_private.h.


Typedef Documentation

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)

Logger type (ccnr_logger).

Definition at line 143 of file ccnr_private.h.


Enumeration Type Documentation

fdholder meter index

Enumerator:
FM_BYTI 
FM_BYTO 
FM_DATI 
FM_INTO 
FM_DATO 
FM_INTI 
CCNR_FACE_METER_N 

Definition at line 282 of file ccnr_private.h.

Enumerator:
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.

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.

Enumerator:
ES_PENDING 
ES_INACTIVE 
ES_ACTIVE 

Definition at line 419 of file ccnr_private.h.


Function Documentation

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   
)

int ccnr_hwm_compare ( struct ccnr_handle ccnr,
ccnr_hwm  x,
ccnr_hwm  y 
)

Definition at line 107 of file ccnr_sync.c.

Referenced by HeartbeatAction().

ccnr_hwm ccnr_hwm_decode ( struct ccnr_handle ,
uintmax_t   
)

Definition at line 83 of file ccnr_sync.c.

Referenced by fetchStablePoint().

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   
)

Definition at line 95 of file ccnr_sync.c.

Referenced by SyncAddName(), and SyncNotifyContent().

struct ccnr_handle* r_init_create ( const char *  progname,
ccnr_logger  logger,
void *  loggerdata 
) [read]

Create a new ccnr instance.

Parameters:
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  ) 


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