blob: 863bf0414dffdc605367151149dc5d53c29ace63 [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
Jeff Thompsone589c3f2013-10-12 17:30:50 -07008#define NDN_FORWARDING_FLAGS_H
Jeff Thompson1f8a31a2013-09-30 16:18:47 -07009
Jeff Thompsone589c3f2013-10-12 17:30:50 -070010#ifdef __cplusplus
Jeff Thompson1f8a31a2013-09-30 16:18:47 -070011extern "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
Jeff Thompsone589c3f2013-10-12 17:30:50 -070051#ifdef __cplusplus
Jeff Thompson1f8a31a2013-09-30 16:18:47 -070052}
53#endif
54
55#endif