File: make_sockdfc.c

package info (click to toggle)
socks4-server 4.3.beta2-9
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,532 kB
  • ctags: 1,777
  • sloc: ansic: 19,309; makefile: 400; sh: 69
file content (29 lines) | stat: -rw-r--r-- 619 bytes parent folder | download | duplicates (9)
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
/* make_sockdfc */

#include <string.h>
#include <stdio.h>
#include "socks.h"

char *infile = SOCKD_CONF, *outfile = SOCKD_FC;

main(argc, argv)
int argc;
char **argv;
{
	struct config *confAddr = NULL;
	int Nconf = 0;
	char *ptr1 = NULL, *ptr2 = NULL;
	int useSyslog = 0;

	if ((argc == 2) || (argc == 3))
		infile = *++argv;
	if (argc == 3)
		outfile = *++argv;
	if (sockd_rdconf(infile, &confAddr, &Nconf, &ptr1, &ptr2, useSyslog) == -1) {
		fprintf(stderr, "File  %s not found\n", infile);
		exit(1);
	}
	socks_wrfz(outfile, confAddr, Nconf, useSyslog);
	printf("Frozen configuration written to %s\n", outfile);
}