corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 ##! Add countries for the originator and responder of a connection
2 ##! to the connection logs.
3  
4 module Conn;
5  
6 export {
7 redef record Conn::Info += {
8 ## Country code for the originator of the connection based
9 ## on a GeoIP lookup.
10 orig_cc: string &optional &log;
11 ## Country code for the responser of the connection based
12 ## on a GeoIP lookup.
13 resp_cc: string &optional &log;
14 };
15 }
16  
17 event connection_state_remove(c: connection)
18 {
19 local orig_loc = lookup_location(c$id$orig_h);
20 if ( orig_loc?$country_code )
21 c$conn$orig_cc = orig_loc$country_code;
22  
23 local resp_loc = lookup_location(c$id$resp_h);
24 if ( resp_loc?$country_code )
25 c$conn$resp_cc = resp_loc$country_code;
26 }