#include <Stmt.h>
Inheritance diagram for AlarmStmt:


Public Member Functions | |
| AlarmStmt (ListExpr *l) | |
Protected Member Functions | |
| AlarmStmt () | |
| Val * | DoExec (val_list *vals, stmt_flow_type &flow) const |
| DECLARE_SERIAL (AlarmStmt) | |
Friends | |
| class | Stmt |
|
|
Definition at line 139 of file Stmt.h. References STMT_ALARM.
00139 : ExprListStmt(STMT_ALARM, l) { } |
|
|
Definition at line 143 of file Stmt.h.
00143 {}
|
|
|
|
|
||||||||||||
|
Implements ExprListStmt. Definition at line 273 of file Stmt.cc. References alarm_hook, args, bro_logger, ODesc::Description(), CallExpr::Eval(), Val::IsOne(), Logger::Log(), ExprListStmt::PrintVals(), BroObj::Unref, and Val.
00274 {
00275 ODesc d;
00276 PrintVals(&d, vals, 0);
00277
00278 if ( alarm_hook )
00279 {
00280 ListExpr* args = new ListExpr();
00281 args->Append(new ConstExpr(new StringVal(d.Description())));
00282
00283 CallExpr* ce =
00284 new CallExpr(new ConstExpr(new Val(alarm_hook)), args);
00285
00286 Val* hook_eval = ce->Eval(0);
00287 int do_log = hook_eval->IsOne();
00288
00289 Unref(ce);
00290 Unref(hook_eval);
00291
00292 if ( ! do_log )
00293 return 0;
00294 }
00295
00296 bro_logger->Log(d.Description());
00297 return 0;
00298 }
|
|
|
|
1.3.5