blob: ba6f6b5b8be10c6fffe6f25fbfd026a56d221aa4 [file] [log] [blame]
Jeff Thompson1f8a31a2013-09-30 16:18:47 -07001/**
2 * Copyright (C) 2013 Regents of the University of California.
3 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
4 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NDN_FORWARDING_FLAGS_H
8#define NDN_FORWARDING_FLAGS_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/**
15 * An ndn_ForwardingFlags object holds the flags which specify how the forwarding daemon should forward an interest for
16 * a registered prefix. We use a separate ForwardingFlags object to retain future compatibility if the daemon forwarding
17 * bits are changed, amended or deprecated.
18 */
19struct ndn_ForwardingFlags {
20 int active; /**< 1 if the flag is set, 0 if cleared. */
21 int childInherit;
22 int advertise;
23 int last;
24 int capture;
25 int local;
26 int tap;
27 int captureOk;
28};
29
30/**
31 * Initialize an ndn_ForwardingFlags struct with the default with "active" and "childInherit" set and all other flags cleared.
32 * @param self A pointer to the ndn_ForwardingFlags struct.
33 */
34void ndn_ForwardingFlags_initialize(struct ndn_ForwardingFlags *self);
35
36/**
37 * Get an integer with the bits set according to the flags as used by the ForwardingEntry message.
38 * @param self A pointer to the ndn_ForwardingFlags struct.
39 * @return An integer with the bits set.
40 */
41int ndn_ForwardingFlags_getForwardingEntryFlags(struct ndn_ForwardingFlags *self);
42
43/**
44 * Set the flags according to the bits in forwardingEntryFlags as used by the ForwardingEntry message.
45 * @param self A pointer to the ndn_ForwardingFlags struct.
46 * @param flags An integer with the bits set.
47 */
48void ndn_ForwardingFlags_setForwardingEntryFlags(struct ndn_ForwardingFlags *self, int forwardingEntryFlags);
49
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif