mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-25 12:23:59 +00:00
cc_name
This commit is contained in:
parent
7fa59a14f7
commit
41ad0b4006
@ -180,6 +180,7 @@ void init_options (struct ccx_s_options *options)
|
|||||||
options->send_to_srv = 0;
|
options->send_to_srv = 0;
|
||||||
options->tcpport = NULL;
|
options->tcpport = NULL;
|
||||||
options->tcp_password = NULL;
|
options->tcp_password = NULL;
|
||||||
|
options->tcp_cc_name = NULL;
|
||||||
options->srv_addr = NULL;
|
options->srv_addr = NULL;
|
||||||
options->srv_port = NULL;
|
options->srv_port = NULL;
|
||||||
options->line_terminator_lf=0; // 0 = CRLF
|
options->line_terminator_lf=0; // 0 = CRLF
|
||||||
@ -431,7 +432,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (ccx_options.send_to_srv)
|
if (ccx_options.send_to_srv)
|
||||||
{
|
{
|
||||||
connect_to_srv(ccx_options.srv_addr, ccx_options.srv_port);
|
connect_to_srv(ccx_options.srv_addr, ccx_options.srv_port, ccx_options.tcp_cc_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ccx_options.write_format!=CCX_OF_NULL)
|
if (ccx_options.write_format!=CCX_OF_NULL)
|
||||||
|
@ -121,6 +121,7 @@ struct ccx_s_options // Options from user parameters
|
|||||||
unsigned send_to_srv;
|
unsigned send_to_srv;
|
||||||
char *tcpport;
|
char *tcpport;
|
||||||
char *tcp_password;
|
char *tcp_password;
|
||||||
|
char *tcp_cc_name;
|
||||||
char *srv_addr;
|
char *srv_addr;
|
||||||
char *srv_port;
|
char *srv_port;
|
||||||
int line_terminator_lf; // 0 = CRLF, 1=LF
|
int line_terminator_lf; // 0 = CRLF, 1=LF
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#define OK 1
|
#define OK 1
|
||||||
#define PASSWORD 2
|
#define PASSWORD 2
|
||||||
#define BIN_MODE 3
|
#define BIN_MODE 3
|
||||||
|
#define CC_NAME 4
|
||||||
#define ERROR 51
|
#define ERROR 51
|
||||||
#define UNKNOWN_COMMAND 52
|
#define UNKNOWN_COMMAND 52
|
||||||
#define WRONG_PASSWORD 53
|
#define WRONG_PASSWORD 53
|
||||||
@ -66,7 +67,7 @@ void init_sockets (void);
|
|||||||
void pr_command(char c);
|
void pr_command(char c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void connect_to_srv(const char *addr, const char *port)
|
void connect_to_srv(const char *addr, const char *port, const char *cc_name)
|
||||||
{
|
{
|
||||||
if (NULL == addr)
|
if (NULL == addr)
|
||||||
{
|
{
|
||||||
@ -86,6 +87,12 @@ void connect_to_srv(const char *addr, const char *port)
|
|||||||
if (ask_passwd(srv_sd) < 0)
|
if (ask_passwd(srv_sd) < 0)
|
||||||
fatal(EXIT_FAILURE, "Unable to connect\n");
|
fatal(EXIT_FAILURE, "Unable to connect\n");
|
||||||
|
|
||||||
|
if (cc_name != NULL &&
|
||||||
|
write_block(srv_sd, CC_NAME, cc_name, strlen(cc_name)) < 0)
|
||||||
|
{
|
||||||
|
fatal(EXIT_FAILURE, "Unable to connect\n");
|
||||||
|
}
|
||||||
|
|
||||||
mprint("Connected to %s:%s\n", addr, port);
|
mprint("Connected to %s:%s\n", addr, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
void connect_to_srv(const char *addr, const char *port);
|
void connect_to_srv(const char *addr, const char *port, const char *cc_name);
|
||||||
|
|
||||||
void net_send_header(const unsigned char *data, size_t len);
|
void net_send_header(const unsigned char *data, size_t len);
|
||||||
void net_send_cc(const unsigned char *data, size_t len);
|
void net_send_cc(const unsigned char *data, size_t len);
|
||||||
|
@ -429,6 +429,7 @@ void usage (void)
|
|||||||
mprint (" -tcp port: Reads the input data in BIN format according to CCExtractor's\n");
|
mprint (" -tcp port: Reads the input data in BIN format according to CCExtractor's\n");
|
||||||
mprint (" protocol, listening specified port on the local host\n");
|
mprint (" protocol, listening specified port on the local host\n");
|
||||||
mprint (" -tcppassword password: Sets server password for new connections to tcp server\n");
|
mprint (" -tcppassword password: Sets server password for new connections to tcp server\n");
|
||||||
|
mprint (" -tcpccname name: Sends to the server caption name, e.g. channel name or file name\n");
|
||||||
mprint ("Options that affect what will be processed:\n");
|
mprint ("Options that affect what will be processed:\n");
|
||||||
mprint (" -1, -2, -12: Output Field 1 data, Field 2 data, or both\n");
|
mprint (" -1, -2, -12: Output Field 1 data, Field 2 data, or both\n");
|
||||||
mprint (" (DEFAULT is -1)\n");
|
mprint (" (DEFAULT is -1)\n");
|
||||||
@ -1667,6 +1668,14 @@ void parse_parameters (int argc, char *argv[])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp (argv[i],"-tcpccname")==0 && i<argc-1)
|
||||||
|
{
|
||||||
|
ccx_options.tcp_cc_name = argv[i + 1];
|
||||||
|
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
fatal (EXIT_INCOMPATIBLE_PARAMETERS, "Error: Parameter %s not understood.\n", argv[i]);
|
fatal (EXIT_INCOMPATIBLE_PARAMETERS, "Error: Parameter %s not understood.\n", argv[i]);
|
||||||
// Unrecognized switches are silently ignored
|
// Unrecognized switches are silently ignored
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user