1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
struct peerinfo:obj {
//uchar peerid[HASHLEN];
struct peerid stpeerid;
struct unhashedid stunhashed;
struct uptime stuptime;
struct addressinfo staddr;
struct resourcelist streslist;
struct x509 stx509;
public:
peerinfo();
//peerinfo(const peerinfo& lstpeer);
bool operator < (peerinfo& rhs) {
BigInt rhs_bigint, my_bigint;
uchar_to_bigint((uchar*)stpeerid.id, idlen, my_bigint);
uchar_to_bigint((uchar*)rhs.stpeerid.id, idlen, rhs_bigint);
return my_bigint < rhs_bigint;
}
bool operator == (peerinfo rhs) {
BigInt rhs_bigint, my_bigint;
uchar_to_bigint((uchar*)stpeerid.id, idlen, my_bigint);
uchar_to_bigint((uchar*)rhs.stpeerid.id, idlen, rhs_bigint);
return (my_bigint == rhs_bigint);
}
int parse(uchar* buf, int size, int& cur);
int encode(uchar* buf, int size, int& cur);
void Initialize();
//peerinfo& operator=(const peerinfo& lstpeer);
};
|