* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <argp.h>
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <wordexp.h>
#define MAX_PKG_LEN (64*1000)
#define BUFFER_SIZE (MAX_PKG_LEN + 1024)
#define TEST_FQDN_LEN 128
#define TEST_IPv4ADDR_LEN 16
typedefstruct{
uint16_tport;
uint32_thostIp;
charfqdn[TEST_FQDN_LEN];
uint16_tpktLen;
}info_s;
typedefstructArguments{
charhost[TEST_IPv4ADDR_LEN];
charfqdn[TEST_FQDN_LEN];
uint16_tport;
uint16_tmax_port;
uint16_tpktLen;
}SArguments;
staticstructargp_optionoptions[]={
{0,'h',"host ip",0,"The host ip to connect to TDEngine. Default is localhost.",0},
{0,'p',"port",0,"The TCP or UDP port number to use for the connection. Default is 6030.",1},
{0,'m',"max port",0,"The max TCP or UDP port number to use for the connection. Default is 6042.",2},
{0,'f',"host fqdn",0,"The host fqdn to connect to TDEngine.",3},
{0,'l',"test pkg len",0,"The len of pkg for test. Default is 1000 Bytes, max not greater than 64k Bytes.\nNotes: This parameter must be consistent between the client and the server.",3}};
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <argp.h>
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
#define MAX_PKG_LEN (64*1000)
#define BUFFER_SIZE (MAX_PKG_LEN + 1024)
typedefstruct{
intport;
uint16_tpktLen;
}info_s;
typedefstructArguments{
char*host;
uint16_tport;
uint16_tmax_port;
uint16_tpktLen;
}SArguments;
staticstructargp_optionoptions[]={
{0,'h',"host",0,"The host to connect to TDEngine. Default is localhost.",0},
{0,'p',"port",0,"The TCP or UDP port number to use for the connection. Default is 6041.",1},
{0,'m',"max port",0,"The max TCP or UDP port number to use for the connection. Default is 6060.",2},
{0,'l',"test pkg len",0,"The len of pkg for test. Default is 1000 Bytes, max not greater than 64k Bytes.\nNotes: This parameter must be consistent between the client and the server.",3}};