Lines Matching refs:cp

35 static void put_method(char *cp, int method);
36 static void put_socks5_addr(char *cp, const unsigned char *buf, int fraglen);
37 static void put_socks4_res(char *cp, int code);
38 static void put_socks5_res(char *cp, int code);
47 char *cp;
52 cp = get_sum_line();
63 (void) sprintf(cp,
68 cp += strlen(cp);
70 (void) sprintf(cp, " User=");
71 cp += strlen(cp);
77 *cp++ = buf[i];
80 *cp++ = '.';
81 *cp++ = '.';
82 *cp++ = '.';
84 *cp = '\0';
89 (void) sprintf(cp, "SOCKS4 OP=%u", n);
95 (void) sprintf(cp,
97 cp += strlen(cp);
99 put_method(cp, buf[2 + i]);
100 cp += strlen(cp);
106 (void) sprintf(cp,
121 (void) sprintf(cp, "SOCKS5 %s ", cmd);
122 cp += strlen(cp);
123 put_socks5_addr(cp, &buf[3],
127 (void) sprintf(cp, "SOCKS (send data): %s",
132 (void) sprintf(cp, "SOCKS (send data): %s",
136 (void) sprintf(cp, "SOCKS (send data): %s",
145 cp = get_line(0, 0);
149 (void) sprintf(cp, "Version = 4");
166 cp = get_line(0, 0);
167 (void) sprintf(cp,
169 cp += strlen(cp);
175 *cp++ = buf[i];
178 *cp++ = '.';
179 *cp++ = '.';
180 *cp++ = '.';
182 *cp = '\0';
192 (void) sprintf(cp, "Version = 5");
199 cp = get_line(0, 0);
200 (void) sprintf(cp,
202 cp += strlen(cp);
203 put_method(cp, buf[2 + i]);
208 (void) sprintf(cp,
231 (void) sprintf(cp,
237 (void) sprintf(cp,
243 (void) sprintf(cp,
259 char *cp;
263 cp = get_sum_line();
267 (void) sprintf(cp, "SOCKS4 ");
268 cp += strlen(cp);
272 (void) sprintf(cp, "%s:%u ",
275 cp += strlen(cp);
278 put_socks4_res(cp, buf[1]);
281 (void) sprintf(cp, "SOCKS5 method accepted:");
282 cp += strlen(cp);
283 put_method(cp, buf[1]);
286 (void) sprintf(cp, "SOCKS (recv data)");
289 (void) sprintf(cp, "SOCKS (recv data)");
295 cp = get_line(0, 0);
300 (void) sprintf(cp,
310 cp = get_line(0, 0);
311 (void) sprintf(cp, "Result code = %u ", buf[1]);
312 cp += strlen(cp);
313 put_socks4_res(cp, buf[1]);
316 (void) sprintf(cp, "Reply version = 5");
318 cp = get_line(0, 0);
319 (void) sprintf(cp, "Method accepted =");
320 cp += strlen(cp);
321 put_method(cp, buf[1]);
323 cp = get_line(0, 0);
324 (void) sprintf(cp, "Status = ");
325 cp += strlen(cp);
326 put_socks5_res(cp, buf[1]);
332 (void) sprintf(cp, "(recv data)");
335 (void) sprintf(cp, "(recv data)");
344 put_method(char *cp, int method)
348 (void) sprintf(cp, " NOAUTH");
351 (void) sprintf(cp, " GSSAPI");
354 (void) sprintf(cp, " USERNAME/PASSWD");
357 (void) sprintf(cp, " NONE");
360 (void) sprintf(cp, " 0x%02x (unknown)", method);
365 put_socks5_addr(char *cp, const unsigned char *buf, int fraglen)
373 (void) sprintf(cp, "Address = ");
374 cp += strlen(cp);
377 (void) sprintf(cp, "%s:%u",
381 (void) strcat(cp, "(IPv4)");
385 (void) sprintf(cp, "Domain name = ");
386 cp += strlen(cp);
388 *cp++ = buf[1 + i];
390 (void) sprintf(cp, ":%u",
393 *cp = '\0';
397 (void) sprintf(cp, "Address = ");
401 *cp++ = '.';
402 (void) sprintf(cp, "%u", buf[1 + i]);
403 cp += strlen(cp);
406 (void) sprintf(cp, ":%u",
410 (void) strcat(cp, "(IPv6)");
413 (void) sprintf(cp, "Address type = 0x%02x (unknown)", buf[0]);
418 put_socks4_res(char *cp, int code)
422 (void) sprintf(cp, "request granted");
425 (void) sprintf(cp, "request rejected or failed");
428 (void) sprintf(cp, "socksd can't connect to client's identd");
431 (void) sprintf(cp, "identity mismatch");
434 (void) sprintf(cp, "0x%02x (unknown)", code);
439 put_socks5_res(char *cp, int code)
443 (void) strcpy(cp, "succeeded");
446 (void) strcpy(cp, "general SOCKS server failure");
449 (void) strcpy(cp, "connection not allowed by ruleset");
452 (void) strcpy(cp, "network unreachable");
455 (void) strcpy(cp, "host unreachable");
458 (void) strcpy(cp, "connection refused");
461 (void) strcpy(cp, "TTL expired");
464 (void) strcpy(cp, "command not supported");
467 (void) strcpy(cp, "address type not supported");
470 (void) sprintf(cp, "code 0x%02x", code);