updated client SPA verbose message to include the server IP/host
This commit is contained in:
parent
8e4b45dd56
commit
044ea54d93
@ -45,11 +45,8 @@ static void run_last_args(fko_cli_options_t *options);
|
||||
static int set_message_type(fko_ctx_t ctx, fko_cli_options_t *options);
|
||||
static int set_nat_access(fko_ctx_t ctx, fko_cli_options_t *options);
|
||||
static int get_rand_port(fko_ctx_t ctx);
|
||||
static void dump_transmit_options(const fko_cli_options_t *options);
|
||||
|
||||
int resolve_ip_http(fko_cli_options_t *options);
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@ -274,9 +271,6 @@ main(int argc, char **argv)
|
||||
if (options.rand_port)
|
||||
options.spa_dst_port = get_rand_port(ctx);
|
||||
|
||||
if (options.verbose)
|
||||
dump_transmit_options(&options);
|
||||
|
||||
res = send_spa_packet(ctx, &options);
|
||||
if(res < 0)
|
||||
{
|
||||
@ -370,29 +364,6 @@ main(int argc, char **argv)
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
static void
|
||||
print_proto(const int proto)
|
||||
{
|
||||
switch (proto) {
|
||||
case FKO_PROTO_UDP:
|
||||
printf("udp");
|
||||
break;
|
||||
case FKO_PROTO_TCP_RAW:
|
||||
printf("tcpraw");
|
||||
break;
|
||||
case FKO_PROTO_TCP:
|
||||
printf("tcp");
|
||||
break;
|
||||
case FKO_PROTO_ICMP:
|
||||
printf("icmp");
|
||||
break;
|
||||
case FKO_PROTO_HTTP:
|
||||
printf("http");
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
get_rand_port(fko_ctx_t ctx)
|
||||
{
|
||||
@ -425,15 +396,6 @@ get_rand_port(fko_ctx_t ctx)
|
||||
return port;
|
||||
}
|
||||
|
||||
static void
|
||||
dump_transmit_options(const fko_cli_options_t *options)
|
||||
{
|
||||
printf("Generating SPA packet:\n protocol: ");
|
||||
print_proto(options->spa_proto),
|
||||
printf("\n port: %d\n", options->spa_dst_port);
|
||||
return;
|
||||
}
|
||||
|
||||
/* See if the string is of the format "<ipv4 addr>:<port>",
|
||||
*/
|
||||
static int
|
||||
|
||||
@ -32,6 +32,39 @@
|
||||
#include "spa_comm.h"
|
||||
#include "utils.h"
|
||||
|
||||
static void
|
||||
print_proto(const int proto)
|
||||
{
|
||||
switch (proto) {
|
||||
case FKO_PROTO_UDP:
|
||||
printf("udp");
|
||||
break;
|
||||
case FKO_PROTO_TCP_RAW:
|
||||
printf("tcpraw");
|
||||
break;
|
||||
case FKO_PROTO_TCP:
|
||||
printf("tcp");
|
||||
break;
|
||||
case FKO_PROTO_ICMP:
|
||||
printf("icmp");
|
||||
break;
|
||||
case FKO_PROTO_HTTP:
|
||||
printf("http");
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
dump_transmit_options(const fko_cli_options_t *options)
|
||||
{
|
||||
printf("Generating SPA packet:\n protocol: ");
|
||||
print_proto(options->spa_proto),
|
||||
printf("\n port: %d\n", options->spa_dst_port);
|
||||
printf(" IP/host: %s\n", options->spa_server_str);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Function to generate a header checksum.
|
||||
*/
|
||||
unsigned short
|
||||
@ -511,6 +544,9 @@ send_spa_packet(fko_ctx_t ctx, fko_cli_options_t *options)
|
||||
|
||||
errno = 0;
|
||||
|
||||
if (options->verbose)
|
||||
dump_transmit_options(options);
|
||||
|
||||
if (options->spa_proto == FKO_PROTO_TCP || options->spa_proto == FKO_PROTO_UDP)
|
||||
{
|
||||
res = send_spa_packet_tcp_or_udp(spa_data, sd_len, options);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user