1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
/*
dtn2fw.h: definitions supporting the implementation
of the forwarding infrastructure for
DTN2-style endpoint IDs.
Author: Scott Burleigh, JPL
Modification History:
Date Who What
Copyright (c) 2006, California Institute of Technology.
ALL RIGHTS RESERVED. U.S. Government Sponsorship
acknowledged.
*/
#ifndef _DTN2FW_H_
#define _DTN2FW_H_
#include "bpP.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
Object demux; /* SDR string */
FwdDirective directive;
} Dtn2Rule;
/* DTN2 forwarding rules are managed in the non-volatile linked
* list of Dtn2Plan objects that associate egress directives
* with node name patterns. Each plan may have an associated
* list of Dtn2Rules indicating the egress directives for bundles
* that are characterized by a specific demux token. Each plan
* also has a default directive, which applies to all bundles
* for which no demux-specific Dtn2Rules apply. */
typedef struct
{
Object nodeName; /* SDR string */
FwdDirective defaultDirective;
Object rules; /* (Dtn2Rule *) */
} Dtn2Plan;
typedef struct
{
Object plans;
} DtnDB;
extern int dtn2Init();
extern Object getDtnDbObject();
extern DtnDB *getDtnConstants();
extern void dtn2_destroyDirective(FwdDirective *directive);
extern int dtn2_lookupDirective(char *nodeName, char *demux,
Bundle *bundle, FwdDirective *directive);
extern void dtn2_findPlan(char *nodeName, Object *planAddr,
Object *elt);
extern int dtn2_addPlan(char *nodeName,
FwdDirective *defaultDirective);
extern int dtn2_updatePlan(char *nodeName,
FwdDirective *defaultDirective);
extern int dtn2_removePlan(char *nodeName);
extern void dtn2_findRule(char *nodeName, char *demux,
Dtn2Plan *plan, Object *ruleAddr, Object *elt);
extern int dtn2_addRule(char *nodeName, char *demux,
FwdDirective *directive);
extern int dtn2_updateRule(char *nodeName, char *demux,
FwdDirective *directive);
extern int dtn2_removeRule(char *nodeName, char *demux);
#ifdef __cplusplus
}
#endif
#endif /* _DTN2FW_H_ */
|