24 |
|
|
25 |
result = "(" + request_code_string(reqtype) + " " |
result = "(" + request_code_string(reqtype) + " " |
26 |
+ nas + " " + (string)id + " " |
+ nas + " " + (string)id + " " |
27 |
+ "\"" quote_string(%[User-Name]) + "\""; |
+ "\"" + quote_string(%[User-Name]) + "\""; |
28 |
if (*%[Calling-Station-Id]) |
if (*%[Calling-Station-Id]) |
29 |
result = result + " CLID=" + %[Calling-Station-Id]; |
result = result + " CLID=" + %[Calling-Station-Id]; |
30 |
if (*%[Called-Station-Id]) |
if (*%[Called-Station-Id]) |
39 |
prefix-hook "compat_log_prefix"; |
prefix-hook "compat_log_prefix"; |
40 |
suffix-hook "compat_log_suffix"; */ |
suffix-hook "compat_log_suffix"; */ |
41 |
|
|
42 |
|
/* Convert integer request type to its abbreviation used in versions |
43 |
|
1.0 - 1.1 */ |
44 |
|
string |
45 |
|
old_request_code_string(integer reqtype) |
46 |
|
{ |
47 |
|
if (reqtype == 1) |
48 |
|
return "AUTHREQ"; |
49 |
|
else if (reqtype == 2) |
50 |
|
return "AUTHACK"; |
51 |
|
else if (reqtype == 3) |
52 |
|
return "AUTHREJ"; |
53 |
|
else if (reqtype == 4) |
54 |
|
return "ACCTREQ"; |
55 |
|
else if (reqtype == 5) |
56 |
|
return "ACCTRES"; |
57 |
|
else if (reqtype == 6) |
58 |
|
return "ACCTSTA"; |
59 |
|
else if (reqtype == 7) |
60 |
|
return "PASSREQ"; |
61 |
|
else if (reqtype == 8) |
62 |
|
return "PASSACK"; |
63 |
|
else if (reqtype == 9) |
64 |
|
return "PASSREJ"; |
65 |
|
else if (reqtype == 10) |
66 |
|
return "ACCTMSG"; |
67 |
|
else if (reqtype == 11) |
68 |
|
return "CHALNGE"; |
69 |
|
else if (reqtype == 12) |
70 |
|
return "SRVSTAT"; |
71 |
|
return (string) reqtype; |
72 |
|
} |
73 |
|
|
74 |
string |
string |
75 |
compat_log_prefix(integer reqtype, string nas, integer id) |
compat_log_prefix(integer reqtype, string nas, integer id) |
76 |
{ |
{ |
77 |
string result; |
string result; |
78 |
|
|
79 |
result = "(" + request_code_string(reqtype) + " " |
result = "(" + old_request_code_string(reqtype) + " " |
80 |
+ nas + " " + (string)id + " " + %[User-Name]; |
+ nas + " " + (string)id + " " + %[User-Name]; |
81 |
if (*%[Acct-Session-Id]) |
if (*%[Acct-Session-Id]) |
82 |
result = result + %[Acct-Session-Id]; |
result = result + %[Acct-Session-Id]; |