summaryrefslogtreecommitdiff
blob: bc29e3eee9194c3b3ce1ce8fe4e7bf14b09f6eee (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff -urN aiccu_2005.01.31/common/aiccu.c aiccu-work/common/aiccu.c
--- aiccu_2005.01.31/common/aiccu.c	2005-01-11 13:16:09.000000000 +0100
+++ aiccu-work/common/aiccu.c	2005-07-20 14:25:46.000000000 +0200
@@ -18,6 +18,7 @@
 struct pl_rule aiccu_conf_rules[] =
 {
 	/* Configuration */
+	{"tic_server",		PLRT_STRING,	offsetof(struct AICCU_conf, tic_server)},
 	{"username",		PLRT_STRING,	offsetof(struct AICCU_conf, username)},
 	{"password",		PLRT_STRING,	offsetof(struct AICCU_conf, password)},
 	{"ipv4_interface",	PLRT_STRING,	offsetof(struct AICCU_conf, ipv4_interface)},
@@ -87,6 +88,12 @@
 
 	fprintf(f, "# AICCU Configuration (Automatically stored by aiccu %s)\n", AICCU_VER);
 	fprintf(f, "\n");
+	if(g_aiccu->tic_server)
+	{
+		fprintf(f, "# TIC server\n");
+		fprintf(f, "tic_server %s\n", g_aiccu->tic_server);
+		fprintf(f, "\n");
+	}
 	fprintf(f, "# Login information\n");
 	fprintf(f, "username %s\n", g_aiccu->username);
 	fprintf(f, "password %s\n", g_aiccu->password);
@@ -116,6 +123,8 @@
 void aiccu_FreeConfig()
 {
 	if (!g_aiccu) return;
+	if (g_aiccu->tic_server)	free(g_aiccu->tic_server);
+	g_aiccu->tic_server = NULL;
 	if (g_aiccu->username)		free(g_aiccu->username);
 	g_aiccu->username = NULL;
 	if (g_aiccu->password)		free(g_aiccu->password);
diff -urN aiccu_2005.01.31/common/aiccu.h aiccu-work/common/aiccu.h
--- aiccu_2005.01.31/common/aiccu.h	2005-01-31 20:05:52.000000000 +0100
+++ aiccu-work/common/aiccu.h	2005-07-20 14:24:44.000000000 +0200
@@ -73,6 +73,7 @@
 	bool		verbose;
 
 	/* Only for AICCU */
+	char		*tic_server;
 	char		*username;
 	char		*password;
 	char		*ipv4_interface;
diff -urN aiccu_2005.01.31/common/tic.c aiccu-work/common/tic.c
--- aiccu_2005.01.31/common/tic.c	2005-02-02 19:52:29.000000000 +0100
+++ aiccu-work/common/tic.c	2005-07-20 14:26:08.000000000 +0200
@@ -63,6 +63,7 @@
 bool tic_Login(struct TIC_conf *tic, char *username, char *password)
 {
 	char		buf[1024], sSignature[33], sChallenge[1024];
+	char		*server = g_aiccu->tic_server;
 	int		i;
 #ifndef _WIN32
 	struct utsname	utsname;
@@ -74,7 +75,7 @@
 #endif
 
 /* Connect to the TIC server */
-	tic->sock = connect_client(TIC_SERVER, TIC_PORT, AF_INET, SOCK_STREAM);
+	tic->sock = connect_client((server?server:TIC_SERVER), TIC_PORT, AF_INET, SOCK_STREAM);
 	if (tic->sock == -1)
 	{
 		dolog(LOG_ERR, "Couldn't connect to the TIC server\n");