control-parameters.h
1 
21 #ifndef NDN_CONTROL_PARAMETERS_OPTIONS_H
22 #define NDN_CONTROL_PARAMETERS_OPTIONS_H
23 
24 #include <ndn-cpp/c/common.h>
25 #include "forwarding-flags-impl.h"
26 #include "name.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 typedef enum {
33  ndn_NfdForwardingFlags_CHILD_INHERIT = 1,
34  ndn_NfdForwardingFlags_CAPTURE = 2,
35 } ndn_NfdForwardingFlags;
36 
42  int hasName;
43  struct ndn_Name name;
44  int faceId;
45  struct ndn_Blob uri;
48  int origin;
49  int cost;
50  struct ndn_ForwardingFlags flags;
51  struct ndn_Name strategy;
52  ndn_Milliseconds expirationPeriod;
53 };
54 
63 static __inline void
64 ndn_ControlParameters_initialize
65  (struct ndn_ControlParameters *self, struct ndn_NameComponent *nameComponents,
66  size_t maxNameComponents, struct ndn_NameComponent *strategyNameComponents,
67  size_t strategyMaxNameComponents)
68 {
69  self->hasName = 0;
70  ndn_Name_initialize(&self->name, nameComponents, maxNameComponents);
71  self->faceId = -1;
72  ndn_Blob_initialize(&self->uri, 0, 0);
73  self->localControlFeature = -1;
74  self->origin = -1;
75  self->cost = -1;
76  ndn_ForwardingFlags_initialize(&self->flags);
77  ndn_Name_initialize
78  (&self->strategy, strategyNameComponents, strategyMaxNameComponents);
79  self->expirationPeriod = -1.0;
80 }
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif
int cost
-1 for none.
Definition: control-parameters.h:49
struct ndn_Name strategy
nComponents == 0 for none.
Definition: control-parameters.h:51
int localControlFeature
-1 for none.
Definition: control-parameters.h:47
Copyright (C) 2013-2015 Regents of the University of California.
Definition: forwarding-flags.h:38
struct ndn_Blob uri
A Blob whose value is a pointer to pre-allocated buffer.
Definition: control-parameters.h:45
Copyright (C) 2015 Regents of the University of California.
Definition: name-types.h:33
An ndn_Name holds an array of ndn_NameComponent.
Definition: name-types.h:40
int faceId
-1 for none.
Definition: control-parameters.h:44
Copyright (C) 2015 Regents of the University of California.
Definition: blob-types.h:33
int origin
-1 for none.
Definition: control-parameters.h:48
An ndn_ControlParameters holds fields for a ControlParameters which is used in the command interest s...
Definition: control-parameters.h:41
struct ndn_Name name
Only used if hasName.
Definition: control-parameters.h:43
ndn_Milliseconds expirationPeriod
-1 for none.
Definition: control-parameters.h:52