2 ** igmpproxy - IGMP proxy based multicast router
3 ** Copyright (C) 2005 Johnny Egeland <johnny@rlo.org>
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 **----------------------------------------------------------------------------
21 ** This software is derived work from the following software. The original
22 ** source code has been modified from it's original state by the author
25 ** smcroute 0.92 - Copyright (C) 2001 Carsten Schill <carsten@cschill.de>
26 ** - Licensed under the GNU General Public License, version 2
28 ** mrouted 3.9-beta3 - COPYRIGHT 1989 by The Board of Trustees of
29 ** Leland Stanford Junior University.
30 ** - Original license can be found in the Stanford.txt file.
34 #include "igmpproxy.h"
36 int LogLevel
= LOG_ERR
;
37 bool Log2Stderr
= false;
39 void my_log( int Severity
, int Errno
, const char *FmtSt
, ... )
45 va_start( ArgPt
, FmtSt
);
46 Ln
= vsnprintf( LogMsg
, sizeof( LogMsg
), FmtSt
, ArgPt
);
48 snprintf( LogMsg
+ Ln
, sizeof( LogMsg
) - Ln
,
49 "; Errno(%d): %s", Errno
, strerror(Errno
) );
52 if (Severity
<= LogLevel
) {
54 fprintf(stderr
, "%s\n", LogMsg
);
56 syslog(Severity
, "%s", LogMsg
);
60 if( Severity
<= LOG_ERR
)