|
Last change
on this file since 12765 was 12060, checked in by hock@…, 12 years ago |
|
Reintegrate branch: 20130111-hock-message_classes
improvements:
- new message classes (reboost, zero-copy)
- "fast path" for direct links (skip overlay layer)
- link-properties accessible from the application
- SystemQueue can call boost::bind functions
- protlib compatibility removed (32bit overhead saved in every message)
- addressing2
- AddressDiscovery discoveres only addresses on which we're actually listening
- ariba serialization usage reduced (sill used in OverlayMsg)
- Node::connect, easier and cleaner interface to start-up ariba from the application
- ariba configs via JSON, XML, etc (boost::property_tree)
- keep-alive overhead greatly reduced
- (relayed) overlay links can actually be closed now
- lost messages are detected in most cases
- notification to the application when link is transformed into direct-link
- overlay routing: send message to second best hop if it would be dropped otherwise
- SequenceNumbers (only mechanisms, so for: upward compatibility)
- various small fixes
regressions:
- bluetooth is not yet working again
- bootstrap modules deactivated
- liblog4xx is not working (use cout-logging)
This patch brings great performance and stability improvements at cost of backward compatibility.
Also bluetooth and the bootstrap modules have not been ported to the new interfaces, yet.
|
|
File size:
1.7 KB
|
| Rev | Line | |
|---|
| 1 | /*
|
|---|
| 2 | * endpoint.h
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: 26.03.2013
|
|---|
| 5 | * Author: mario
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef ENDPOINT_HPP_
|
|---|
| 9 | #define ENDPOINT_HPP_
|
|---|
| 10 |
|
|---|
| 11 | // system
|
|---|
| 12 | #include <stdint.h>
|
|---|
| 13 | #include <string>
|
|---|
| 14 |
|
|---|
| 15 | // boost
|
|---|
| 16 | #include <boost/shared_ptr.hpp>
|
|---|
| 17 |
|
|---|
| 18 | namespace ariba {
|
|---|
| 19 | namespace addressing2 {
|
|---|
| 20 |
|
|---|
| 21 | struct endpoint_category
|
|---|
| 22 | {
|
|---|
| 23 | enum _ENDPOINT_CATEGORY {
|
|---|
| 24 | INVALID = 0,
|
|---|
| 25 | TCPIP = 1,
|
|---|
| 26 | BLUETOOTH = 2
|
|---|
| 27 | };
|
|---|
| 28 |
|
|---|
| 29 | // static const SEND_PRIORITY_INTERNAL OVERLAY = HIGHEST;
|
|---|
| 30 | };
|
|---|
| 31 | typedef endpoint_category::_ENDPOINT_CATEGORY ENDPOINT_CATEGORY;
|
|---|
| 32 |
|
|---|
| 33 | struct endpoint_type
|
|---|
| 34 | {
|
|---|
| 35 | enum _ENDPOINT_TYPE {
|
|---|
| 36 | INVALID = 0,
|
|---|
| 37 | TCPIPv4 = 1,
|
|---|
| 38 | TCPIPv6 = 2
|
|---|
| 39 | };
|
|---|
| 40 | };
|
|---|
| 41 | typedef endpoint_type::_ENDPOINT_TYPE ENDPOINT_TYPE;
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | class endpoint
|
|---|
| 45 | {
|
|---|
| 46 | public:
|
|---|
| 47 | virtual ~endpoint() {}
|
|---|
| 48 |
|
|---|
| 49 | virtual ENDPOINT_CATEGORY get_category() const = 0;
|
|---|
| 50 | virtual ENDPOINT_TYPE get_type() const = 0;
|
|---|
| 51 |
|
|---|
| 52 | /**
|
|---|
| 53 | * @return Human readable string representation of this endpoint.
|
|---|
| 54 | */
|
|---|
| 55 | virtual std::string to_string() const = 0;
|
|---|
| 56 |
|
|---|
| 57 | /**
|
|---|
| 58 | * Serializes this »endpoint« into a byte_array.
|
|---|
| 59 | *
|
|---|
| 60 | * @param buffer: An array >= »endpoint::size()«
|
|---|
| 61 | * @return »endpoint::size()«
|
|---|
| 62 | */
|
|---|
| 63 | virtual size_t to_byte_array(uint8_t* buffer) const = 0;
|
|---|
| 64 |
|
|---|
| 65 | /**
|
|---|
| 66 | * @return Number of bytes:
|
|---|
| 67 | * - read in »endpoint::endpoint(const uint8_t* byte_array);«
|
|---|
| 68 | * - to be written in »endpoint::to_byte_array(uint8_t* buffer)«
|
|---|
| 69 | */
|
|---|
| 70 | virtual int size() const = 0;
|
|---|
| 71 | };
|
|---|
| 72 |
|
|---|
| 73 | typedef boost::shared_ptr<endpoint> EndpointPtr;
|
|---|
| 74 | //typedef boost::shared_ptr<const endpoint> const_EndpointPtr;
|
|---|
| 75 |
|
|---|
| 76 | // NOTE: An endpoint is designed as an unmutable object!
|
|---|
| 77 |
|
|---|
| 78 | }} /* namespace ariba::addressing2 */
|
|---|
| 79 | #endif /* ENDPOINT_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.