2016-11-06 01:57:36 +00:00
|
|
|
#ifndef MULTIADDR
|
|
|
|
#define MULTIADDR
|
2017-02-13 18:25:43 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2016-11-06 01:57:36 +00:00
|
|
|
#include "varhexutils.h"
|
|
|
|
#include "varint.h"
|
|
|
|
#include "protocols.h"
|
|
|
|
#include "protoutils.h"
|
2017-02-13 18:25:43 +00:00
|
|
|
|
2017-02-13 18:30:22 +00:00
|
|
|
struct MultiAddress
|
2016-11-06 01:57:36 +00:00
|
|
|
{
|
2016-11-08 16:01:10 +00:00
|
|
|
char string[800];
|
|
|
|
uint8_t bytes[400];
|
2016-11-08 11:02:45 +00:00
|
|
|
int bsize[1];
|
2016-11-06 01:57:36 +00:00
|
|
|
};
|
2017-02-13 18:25:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
int strpos(char *haystack, char *needle);
|
|
|
|
|
2017-02-13 18:30:22 +00:00
|
|
|
struct MultiAddress* new_maddr_fb(uint8_t * byteaddress,int size); //Construct new address from bytes
|
2017-02-13 18:25:43 +00:00
|
|
|
|
2017-02-13 18:30:22 +00:00
|
|
|
struct MultiAddress* new_maddr_fs(char * straddress); //Construct new address from string
|
2017-02-13 18:25:43 +00:00
|
|
|
|
2017-02-13 18:30:22 +00:00
|
|
|
void maddr_free(struct MultiAddress* in);
|
2017-02-13 18:25:43 +00:00
|
|
|
|
2017-02-13 18:30:22 +00:00
|
|
|
int m_encapsulate(struct MultiAddress * result, char * string);
|
2017-02-13 18:25:43 +00:00
|
|
|
|
2017-02-13 18:30:22 +00:00
|
|
|
int m_decapsulate(struct MultiAddress * result, char * srci);
|
2016-11-08 11:02:45 +00:00
|
|
|
|
2016-12-05 11:56:09 +00:00
|
|
|
#endif
|