|
|
|
/******************************************************************************
|
|
|
|
* Copyright © 2014-2016 The SuperNET Developers. *
|
|
|
|
* *
|
|
|
|
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
|
|
|
|
* the top-level directory of this distribution for the individual copyright *
|
|
|
|
* holder information and the developer policies on copyright and licensing. *
|
|
|
|
* *
|
|
|
|
* Unless otherwise agreed in a custom licensing agreement, no part of the *
|
|
|
|
* SuperNET software, including this file may be copied, modified, propagated *
|
|
|
|
* or distributed except according to the terms contained in the LICENSE file *
|
|
|
|
* *
|
|
|
|
* Removal or modification of this copyright notice is prohibited. *
|
|
|
|
* *
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
// included from basilisk.c
|
|
|
|
|
|
|
|
char *basilisk_respond_goodbye(struct supernet_info *myinfo,char *CMD,void *_addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
struct iguana_peer *addr = _addr;
|
|
|
|
printf("(%s) sends goodbye\n",remoteaddr);
|
|
|
|
addr->dead = (uint32_t)time(NULL);
|
|
|
|
addr->rank = 0;
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void basilisk_request_goodbye(struct supernet_info *myinfo)
|
|
|
|
{
|
|
|
|
cJSON *valsobj = cJSON_CreateObject();
|
|
|
|
jaddnum(valsobj,"timeout",-1);
|
|
|
|
basilisk_requestservice(myinfo,"BYE",valsobj,GENESIS_PUBKEY,0,0,0);
|
|
|
|
free_json(valsobj);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_publish(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
printf("from.(%s) PUB.(%s) datalen.%d\n",remoteaddr,jprint(valsobj,0),datalen);
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_subscribe(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
printf("from.(%s) SUB.(%s) datalen.%d\n",remoteaddr,jprint(valsobj,0),datalen);
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_dispatch(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_addrelay(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_forward(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_mailbox(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_VPNcreate(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_VPNjoin(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_VPNlogout(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_VPNbroadcast(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_VPNreceive(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *basilisk_respond_VPNmessage(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 pubkey,int32_t from_basilisk)
|
|
|
|
{
|
|
|
|
char *retstr=0;
|
|
|
|
return(retstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
|