summaryrefslogtreecommitdiffstats
path: root/web/attachments/135800-nagiosplug-check_tcp-protocol.diff
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/135800-nagiosplug-check_tcp-protocol.diff')
-rw-r--r--web/attachments/135800-nagiosplug-check_tcp-protocol.diff139
1 files changed, 139 insertions, 0 deletions
diff --git a/web/attachments/135800-nagiosplug-check_tcp-protocol.diff b/web/attachments/135800-nagiosplug-check_tcp-protocol.diff
new file mode 100644
index 0000000..ea63efb
--- /dev/null
+++ b/web/attachments/135800-nagiosplug-check_tcp-protocol.diff
@@ -0,0 +1,139 @@
1diff -urN ../orig.nplg/plugins/check_tcp.c ./plugins/check_tcp.c
2--- ../orig.nplg/plugins/check_tcp.c 2005-05-23 21:55:06.000000000 +0200
3+++ ./plugins/check_tcp.c 2005-05-24 21:13:43.000000000 +0200
4@@ -57,11 +57,7 @@
5 int check_certificate (X509 **);
6 #endif
7
8-enum {
9- TCP_PROTOCOL = 1,
10- UDP_PROTOCOL = 2,
11- MAXBUF = 1024
12-};
13+#define MAXBUF 1024
14
15 int process_arguments (int, char **);
16 int my_recv (void);
17@@ -120,7 +116,7 @@
18 SEND = NULL;
19 EXPECT = NULL;
20 QUIT = NULL;
21- PROTOCOL = UDP_PROTOCOL;
22+ PROTOCOL = IPPROTO_UDP;
23 PORT = 0;
24 }
25 else if (strstr (argv[0], "check_tcp")) {
26@@ -129,7 +125,7 @@
27 SEND = NULL;
28 EXPECT = NULL;
29 QUIT = NULL;
30- PROTOCOL = TCP_PROTOCOL;
31+ PROTOCOL = IPPROTO_TCP;
32 PORT = 0;
33 }
34 else if (strstr (argv[0], "check_ftp")) {
35@@ -138,7 +134,7 @@
36 SEND = NULL;
37 EXPECT = strdup ("220");
38 QUIT = strdup ("QUIT\r\n");
39- PROTOCOL = TCP_PROTOCOL;
40+ PROTOCOL = IPPROTO_TCP;
41 PORT = 21;
42 }
43 else if (strstr (argv[0], "check_smtp")) {
44@@ -147,7 +143,7 @@
45 SEND = NULL;
46 EXPECT = strdup ("220");
47 QUIT = strdup ("QUIT\r\n");
48- PROTOCOL = TCP_PROTOCOL;
49+ PROTOCOL = IPPROTO_TCP;
50 PORT = 25;
51 }
52 else if (strstr (argv[0], "check_pop")) {
53@@ -156,7 +152,7 @@
54 SEND = NULL;
55 EXPECT = strdup ("+OK");
56 QUIT = strdup ("QUIT\r\n");
57- PROTOCOL = TCP_PROTOCOL;
58+ PROTOCOL = IPPROTO_TCP;
59 PORT = 110;
60 }
61 else if (strstr (argv[0], "check_imap")) {
62@@ -165,7 +161,7 @@
63 SEND = NULL;
64 EXPECT = strdup ("* OK");
65 QUIT = strdup ("a1 LOGOUT\r\n");
66- PROTOCOL = TCP_PROTOCOL;
67+ PROTOCOL = IPPROTO_TCP;
68 PORT = 143;
69 }
70 #ifdef HAVE_SSL
71@@ -175,7 +171,7 @@
72 SEND=NULL;
73 EXPECT = strdup ("* OK");
74 QUIT = strdup ("a1 LOGOUT\r\n");
75- PROTOCOL=TCP_PROTOCOL;
76+ PROTOCOL=IPPROTO_TCP;
77 use_ssl=TRUE;
78 PORT=993;
79 }
80@@ -185,7 +181,7 @@
81 SEND=NULL;
82 EXPECT = strdup ("+OK");
83 QUIT = strdup ("QUIT\r\n");
84- PROTOCOL=TCP_PROTOCOL;
85+ PROTOCOL=IPPROTO_TCP;
86 use_ssl=TRUE;
87 PORT=995;
88 }
89@@ -195,7 +191,7 @@
90 SEND=NULL;
91 EXPECT = strdup ("220");
92 QUIT = strdup ("QUIT\r\n");
93- PROTOCOL=TCP_PROTOCOL;
94+ PROTOCOL=IPPROTO_TCP;
95 use_ssl=TRUE;
96 PORT=465;
97 }
98@@ -205,7 +201,7 @@
99 SEND = strdup("<stream:stream to=\'host\' xmlns=\'jabber:client\' xmlns:stream=\'http://etherx.jabber.org/streams\'>\n");
100 EXPECT = strdup("<?xml version=\'1.0\'?><stream:stream xmlns:stream=\'http://etherx.jabber.org/streams\'");
101 QUIT = strdup("</stream:stream>\n");
102- PROTOCOL=TCP_PROTOCOL;
103+ PROTOCOL=IPPROTO_TCP;
104 use_ssl=TRUE;
105 PORT = 5222;
106 }
107@@ -219,7 +215,7 @@
108 server_expect = realloc (server_expect, ++server_expect_count);
109 asprintf (&server_expect[server_expect_count - 1], "201");
110 QUIT = strdup("QUIT\r\n");
111- PROTOCOL = TCP_PROTOCOL;
112+ PROTOCOL = IPPROTO_TCP;
113 use_ssl=TRUE;
114 PORT = 563;
115 }
116@@ -235,7 +231,7 @@
117 server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count));
118 asprintf (&server_expect[server_expect_count - 1], "201");
119 asprintf (&QUIT, "QUIT\r\n");
120- PROTOCOL = TCP_PROTOCOL;
121+ PROTOCOL = IPPROTO_TCP;
122 PORT = 119;
123 }
124 else {
125@@ -288,13 +284,7 @@
126 result = connect_SSL ();
127 else
128 #endif
129- {
130- if (PROTOCOL == UDP_PROTOCOL)
131- result = my_udp_connect (server_address, server_port, &sd);
132- else
133- /* default is TCP */
134- result = my_tcp_connect (server_address, server_port, &sd);
135- }
136+ result = my_connect (server_address, server_port, &sd, PROTOCOL);
137
138 if (result == STATE_CRITICAL)
139 return STATE_CRITICAL;