1 #ifndef _MADARA_QOS_TRANSPORT_SETTINGS_H_ 2 #define _MADARA_QOS_TRANSPORT_SETTINGS_H_ 18 #include "madara/MADARA_export.h" 28 #ifdef _MADARA_PYTHON_CALLBACKS_ 29 #include <boost/python.hpp> 88 void add_send_filter (uint32_t types,
98 void add_send_filter (uint32_t types,
106 void add_send_filter (
void (*
function) (
131 void add_receive_filter (uint32_t types,
141 void add_receive_filter (uint32_t types,
149 void add_receive_filter (
void (*
function) (
168 void add_rebroadcast_filter (uint32_t types,
179 void add_rebroadcast_filter (uint32_t types,
187 void add_rebroadcast_filter (
void (*
function) (
208 void add_receive_filter (
209 uint32_t types, jobject &
object);
217 void add_send_filter (
218 uint32_t types, jobject &
object);
227 void add_rebroadcast_filter (
228 uint32_t types, jobject &
object);
236 void add_receive_filter (jobject &
object);
244 void add_send_filter (jobject &
object);
252 void add_rebroadcast_filter (jobject &
object);
256 #ifdef _MADARA_PYTHON_CALLBACKS_ 265 void add_receive_filter (
266 uint32_t types, boost::python::object &
object);
274 void add_send_filter (
275 uint32_t types, boost::python::object &
object);
284 void add_rebroadcast_filter (
285 uint32_t types, boost::python::object &
object);
293 void add_receive_filter (boost::python::object &
object);
301 void add_send_filter (boost::python::object &
object);
309 void add_rebroadcast_filter (boost::python::object &
object);
325 void clear_send_filters (uint32_t types);
330 void clear_send_aggregate_filters (
void);
336 void clear_receive_filters (uint32_t types);
341 void clear_buffer_filters (
void);
346 void clear_receive_aggregate_filters (
void);
352 void clear_rebroadcast_filters (uint32_t types);
357 void clear_rebroadcast_aggregate_filters (
void);
426 int filter_encode (
unsigned char * source,
int size,
int max_size)
const;
435 int filter_decode (
unsigned char * source,
int size,
int max_size)
const;
441 void print_num_filters_send (
void)
const;
447 void print_num_filters_receive (
void)
const;
453 void print_num_filters_rebroadcast (
void)
const;
461 void set_rebroadcast_ttl (
unsigned char ttl);
467 unsigned char get_rebroadcast_ttl (
void)
const;
473 size_t get_number_of_send_filtered_types (
void)
const;
479 size_t get_number_of_send_aggregate_filters (
void)
const;
486 size_t get_number_of_rebroadcast_aggregate_filters (
void)
const;
492 size_t get_number_of_rebroadcast_filtered_types (
void)
const;
498 size_t get_number_of_receive_aggregate_filters (
void)
const;
504 size_t get_number_of_receive_filtered_types (
void)
const;
510 size_t get_number_of_buffer_filters (
void)
const;
531 bool remove_trusted_peer (
const std::string & peer);
538 bool remove_banned_peer (
const std::string & peer);
554 void enable_participant_ttl (
unsigned char maximum_ttl = 255);
562 unsigned char get_participant_ttl (
void)
const;
571 void update_drop_rate (
double drop_rate,
573 uint64_t drop_burst = 1);
579 double get_drop_rate (
void)
const;
585 int get_drop_type (
void)
const;
591 uint64_t get_drop_burst (
void)
const;
597 void set_send_bandwidth_limit (int64_t bandwidth);
603 int64_t get_send_bandwidth_limit (
void)
const;
610 void set_total_bandwidth_limit (int64_t bandwidth);
617 int64_t get_total_bandwidth_limit (
void)
const;
626 void set_deadline (
double deadline);
632 double get_deadline (
void)
const;
647 virtual void load_text (
const std::string & filename,
663 virtual void save_text (
const std::string & filename,
752 #endif // _MADARA_QOS_TRANSPORT_SETTINGS_H_ This class encapsulates an entry in a KnowledgeBase.
Abstract base class for implementing aggregate record filters via a functor interface.
This class stores variables and their values for use by any entity needing state information in a thr...
Abstract base class for implementing individual record filters via a functor interface.
Holds basic transport settings.
Provides map of data types to a filter chain to apply to the data.
knowledge::KnowledgeRecordFilters send_filters_
A container for filters applied before sending from this host.
std::vector< KnowledgeRecord > FunctionArguments
Provides context about the transport.
unsigned char rebroadcast_ttl_
number of rebroadcasts for receivers to ultimately do.
unsigned char participant_rebroadcast_ttl_
This field is meant to limit the number of rebroadcasts that this transport will participate in...
int packet_drop_type_
Drop rate type.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
double deadline_
Deadline for packets at which packets drop.
filters::BufferFilters buffer_filters_
buffer filters have an encode and decode method
int64_t max_send_bandwidth_
Maximum send bandwidth usage per second before packets drop.
Container for quality-of-service settings.
std::map< std::string, int > trusted_peers_
A container of all trusted peers.
std::list< BufferFilter * > BufferFilters
std::map< std::string, int > banned_peers_
A container of all banned peers.
double packet_drop_rate_
Rate for dropping packets.
int64_t max_total_bandwidth_
Maximum bandwidth usage for the transport (receive/send) before drop.
uint64_t packet_drop_burst_
Burst of packet drops.
Copyright (c) 2015 Carnegie Mellon University.
Abstract base class for implementing buffer filters via a functor interface.
Provides an interface for external functions into the MADARA KaRL variable settings.
knowledge::KnowledgeRecordFilters receive_filters_
A container for receive filters.
knowledge::KnowledgeRecordFilters rebroadcast_filters_
A container for rebroadcast filters.
PacketDropType
Enumeration for packet drop policy types.