mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-21 21:59:02 -04:00
fixed up tlv serialisers:
- Added RsTvlUnit: public RsTlvItem, which handles some of the infrstructure. - made TlvSize() SetTlv() and print() const. - split rstlvtypes into its bits and cleaned up header files. - added templated RsTlvList, imilar to cyrils id one. - removed GXS_GEN_TESTNET - cleanedup rsserviceids. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7215 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1042744685
commit
600639db51
86 changed files with 2464 additions and 2444 deletions
|
@ -1,5 +1,4 @@
|
|||
#ifndef RS_TLV_ADDRS_TYPES_H
|
||||
#define RS_TLV_ADDRS_TYPES_H
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* libretroshare/src/serialiser: rstlvaddrs.h
|
||||
|
@ -30,20 +29,22 @@
|
|||
* These are the Compound TLV structures that must be (un)packed.
|
||||
******************************************************************/
|
||||
|
||||
#include <map>
|
||||
#include "serialiser/rstlvtypes.h"
|
||||
#include "serialiser/rstlvitem.h"
|
||||
#include "util/rsnet.h"
|
||||
#include <list>
|
||||
|
||||
#include "serialiser/rstlvlist.h"
|
||||
|
||||
class RsTlvIpAddress: public RsTlvItem
|
||||
{
|
||||
public:
|
||||
RsTlvIpAddress();
|
||||
virtual ~RsTlvIpAddress() { return; }
|
||||
virtual uint32_t TlvSize();
|
||||
virtual uint32_t TlvSize() const;
|
||||
virtual void TlvClear();
|
||||
virtual bool SetTlv(void *data, uint32_t size, uint32_t *offset); /* serialise */
|
||||
virtual bool GetTlv(void *data, uint32_t size, uint32_t *offset); /* deserialise */
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent);
|
||||
virtual bool SetTlv(void *data, uint32_t size, uint32_t *offset) const;
|
||||
virtual bool GetTlv(void *data, uint32_t size, uint32_t *offset);
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent) const;
|
||||
|
||||
struct sockaddr_storage addr; // Mandatory :
|
||||
};
|
||||
|
@ -54,17 +55,20 @@ class RsTlvIpAddressInfo: public RsTlvItem
|
|||
public:
|
||||
RsTlvIpAddressInfo();
|
||||
virtual ~RsTlvIpAddressInfo() { return; }
|
||||
virtual uint32_t TlvSize();
|
||||
virtual uint32_t TlvSize() const;
|
||||
virtual void TlvClear();
|
||||
virtual bool SetTlv(void *data, uint32_t size, uint32_t *offset); /* serialise */
|
||||
virtual bool GetTlv(void *data, uint32_t size, uint32_t *offset); /* deserialise */
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent);
|
||||
virtual bool SetTlv(void *data, uint32_t size, uint32_t *offset) const;
|
||||
virtual bool GetTlv(void *data, uint32_t size, uint32_t *offset);
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent) const;
|
||||
|
||||
RsTlvIpAddress addr; // Mandatory :
|
||||
uint64_t seenTime; // Mandatory :
|
||||
uint32_t source; // Mandatory :
|
||||
};
|
||||
|
||||
typedef t_RsTlvList<RsTlvIpAddressInfo,TLV_TYPE_ADDRESS_SET> RsTlvIpAddrSet;
|
||||
|
||||
#if 0
|
||||
class RsTlvIpAddrSet: public RsTlvItem
|
||||
{
|
||||
public:
|
||||
|
@ -78,7 +82,6 @@ virtual std::ostream &print(std::ostream &out, uint16_t indent);
|
|||
|
||||
std::list<RsTlvIpAddressInfo> addrs; // Mandatory :
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue