File: view-ip-log

package info (click to toggle)
alien-arena 7.53%2Bdfsg-3
  • links: PTS, VCS
  • area: contrib
  • in suites: wheezy
  • size: 9,384 kB
  • sloc: ansic: 109,452; cpp: 41,132; sh: 4,278; makefile: 545; ruby: 438
file content (65 lines) | stat: -rwxr-xr-x 1,272 bytes parent folder | download | duplicates (7)
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
#!/bin/bash

[ -f "$1" ] || {
	echo "Syntax: $0 <IP log file>";
	exit 1;
};

cat "$1" | sed -e 's/\r//' | while read lf_addr lf_evt lf_hasname lf_name; do
	lf_addr_addr="`echo "${lf_addr}" | cut -d: -f1`"
	lf_addr_port="`echo "${lf_addr}" | cut -d: -f2`"
	printf "%18s %8s " "${lf_addr_addr}" "${lf_addr_port}"
	case "${lf_evt}" in
		RVR)
			echo "Unknown protocol version";
			;;
		R00)
			echo "Rejected - too many connections from host";
			;;
		R01)
			echo "Rejected - userinfo string length exceeded"
			;;
		R02)
			echo "Rejected - empty userinfo"
			;;
		R03)
			echo "Rejected - end-of-message-in-string exploit"
			;;
		R04)
			echo "Rejected - attempted to spoof IP address"
			;;
		R05)
			echo "Rejected - remote connect in attract loop"
			;;
		R06)
			echo "Rejected - bad challenge"
			;;
		R07)
			echo "Rejected - no challenge"
			;;
		R08)
			echo "Rejected - already connected"
			;;
		R09)
			echo "Rejected - trying to reconnect too soon"
			;;
		R10)
			echo "Rejected - server full"
			;;
		GRJ)
			echo "Rejected by game"
			;;
		RCN)
			echo "Client reconnecting"
			;;
		NCN)
			echo "Client establishing new connection"
			;;
		UUS)
			echo "Player ${lf_name} connected";
			;;
		DCN)
			echo "Player ${lf_name} disconnected"
			;;
	esac
done