/[radius]/radius/raddb/log-hook.rw
ViewVC logotype

Diff of /radius/raddb/log-hook.rw

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by gray, Fri Nov 28 15:06:01 2003 UTC revision 1.5 by gray, Tue Dec 2 12:00:40 2003 UTC
# Line 24  default_log_prefix(integer reqtype, stri Line 24  default_log_prefix(integer reqtype, stri
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])
# Line 39  default_log_prefix(integer reqtype, stri Line 39  default_log_prefix(integer reqtype, stri
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];

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26