00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _SPD_H_
00021 #define _SPD_H_
00022
00023 #ifdef BSP_ENABLED
00024
00025 #include <oasys/util/Singleton.h>
00026 #include "bundling/Bundle.h"
00027 #include "bundling/BlockInfo.h"
00028 #include "contacts/Link.h"
00029
00030 namespace dtn {
00031
00040 class SPD : public oasys::Singleton<SPD, false> {
00041 public:
00042
00043 typedef enum {
00044 SPD_DIR_IN,
00045 SPD_DIR_OUT
00046 } spd_direction_t;
00047
00048 typedef enum {
00049 SPD_USE_NONE = 0,
00050 SPD_USE_BAB = 1 << 0,
00051 SPD_USE_CB = 1 << 1,
00052 SPD_USE_PSB = 1 << 2,
00053 } spd_policy_t;
00054
00058 SPD();
00059
00063 ~SPD();
00064
00068 static void init();
00069
00075 static void set_global_policy(spd_direction_t direction,
00076 spd_policy_t policy);
00077
00082 static void prepare_out_blocks(const Bundle* bundle,
00083 const LinkRef& link,
00084 BlockInfoVec* xmit_blocks);
00085
00090 static bool verify_in_policy(const Bundle* bundle);
00091
00092 private:
00093 spd_policy_t global_policy_inbound_;
00094 spd_policy_t global_policy_outbound_;
00095
00104 static spd_policy_t find_policy(spd_direction_t direction,
00105 const Bundle* bundle);
00106
00107 };
00108
00109 }
00110
00111 #endif
00112
00113 #endif