5 /* set up intercept based on RADIUS reply */
7 char const *cvs_id
= "$Id: autosnoop.c,v 1.9 2004/11/29 02:17:17 bodea Exp $";
9 int plugin_api_version
= PLUGIN_API_VERSION
;
10 struct pluginfuncs
*p
;
12 int plugin_radius_response(struct param_radius_response
*data
)
14 if (strcmp(data
->key
, "intercept") == 0)
17 data
->s
->snoop_ip
= 0;
18 data
->s
->snoop_port
= 0;
19 if ((x
= strchr(data
->value
, ':')))
22 if (*data
->value
) data
->s
->snoop_ip
= inet_addr(data
->value
);
23 if (data
->s
->snoop_ip
== INADDR_NONE
) data
->s
->snoop_ip
= 0;
24 if (*x
) data
->s
->snoop_port
= atoi(x
);
25 p
->log(3, p
->get_id_by_session(data
->s
), data
->s
->tunnel
,
26 " Intercepting user to %s:%d\n",
27 p
->fmtaddr(data
->s
->snoop_ip
, 0), data
->s
->snoop_port
);
31 p
->log(3, p
->get_id_by_session(data
->s
), data
->s
->tunnel
,
32 " Not Intercepting user (reply string should be intercept=ip:port)\n");
38 int plugin_init(struct pluginfuncs
*funcs
)
40 return ((p
= funcs
)) ? 1 : 0;