MADARA  3.4.1
Fragmentation.h File Reference
#include <map>
#include <string>
#include <string.h>
#include "madara/utility/StdInt.h"
#include "madara/utility/ScopedArray.h"
#include "madara/MadaraExport.h"
#include "madara/transport/MessageHeader.h"

Go to the source code of this file.

Classes

class  madara::transport::FragmentMessageHeader
 Defines a fragmentation header which allows for multi-part messages that are only applied once all fragments are received. More...
 

Namespaces

 madara
 Copyright(c) 2020 Galois.
 
 madara::transport
 Provides the network transport layer for knowledge bases to communicate within and across agents.
 

Macros

#define FRAGMENTATION_MADARA_ID   "KFRG1.4"
 

Typedefs

typedef std::map< uint64_t, FragmentMap > madara::transport::ClockFragmentMap
 Map of clocks to fragments. More...
 
typedef std::map< uint32_t, utility::ScopedArray< const char > > madara::transport::FragmentMap
 Map of fragment identifiers to fragments. More...
 
typedef std::map< std::string, ClockFragmentMap > madara::transport::OriginatorFragmentMap
 Map of originator to a map of clocks to fragments. More...
 

Functions

MADARA_EXPORT char * madara::transport::add_fragment (const char *originator, uint64_t clock, uint32_t update_number, const char *fragment, uint32_t queue_length, OriginatorFragmentMap &map, uint64_t &total_size, bool clear=true)
 Adds a fragment to an originator fragment map and returns the aggregate message if the message is complete. More...
 
MADARA_EXPORT char * madara::transport::defrag (FragmentMap &map, uint64_t &total_size)
 Pieces together a fragment map into a single buffer. More...
 
MADARA_EXPORT void madara::transport::delete_fragments (FragmentMap &map)
 Deletes fragments within a fragment map and clears the map. More...
 
MADARA_EXPORT bool madara::transport::exists (const char *originator, uint64_t clock, uint32_t update_number, OriginatorFragmentMap &map)
 Checks if a fragment already exists within a fragment map. More...
 
MADARA_EXPORT void madara::transport::frag (const char *source, uint64_t total_size, const char *originator, const char *domain, uint64_t clock, uint64_t timestamp, uint32_t quality, unsigned char ttl, uint64_t fragment_size, FragmentMap &map)
 Breaks a large packet into smaller packets. More...
 
MADARA_EXPORT bool madara::transport::is_complete (const char *originator, uint64_t clock, OriginatorFragmentMap &map)
 Breaks a large packet into smaller packets. More...
 

Detailed Description

Author
James Edmondson jedmo.nosp@m.ndso.nosp@m.n@gma.nosp@m.il.c.nosp@m.om

This file contains the message header used by transports to piece together fragments of a large knowledge update and helpers classes for transports that want to handle fragmented updates

Definition in file Fragmentation.h.

Macro Definition Documentation

◆ FRAGMENTATION_MADARA_ID

#define FRAGMENTATION_MADARA_ID   "KFRG1.4"

Definition at line 25 of file Fragmentation.h.