資源簡介
基于linux的igmp proxy

代碼片段和文件信息
/*
**??igmpproxy?-?IGMP?proxy?based?multicast?router?
**??Copyright?(C)?2005?Johnny?Egeland?
**
**??This?program?is?free?software;?you?can?redistribute?it?and/or?modify
**??it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
**??the?Free?Software?Foundation;?either?version?2?of?the?License?or
**??(at?your?option)?any?later?version.
**
**??This?program?is?distributed?in?the?hope?that?it?will?be?useful
**??but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
**??MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
**??GNU?General?Public?License?for?more?details.
**
**??You?should?have?received?a?copy?of?the?GNU?General?Public?License
**??along?with?this?program;?if?not?write?to?the?Free?Software
**??Foundation?Inc.?59?Temple?Place?Suite?330?Boston?MA??02111-1307??USA
**
**----------------------------------------------------------------------------
**
**??This?software?is?derived?work?from?the?following?software.?The?original
**??source?code?has?been?modified?from?it‘s?original?state?by?the?author
**??of?igmpproxy.
**
**??smcroute?0.92?-?Copyright?(C)?2001?Carsten?Schill?
**??-?Licensed?under?the?GNU?General?Public?License?version?2
**??
**??mrouted?3.9-beta3?-?COPYRIGHT?1989?by?The?Board?of?Trustees?of?
**??Leland?Stanford?Junior?University.
**??-?Original?license?can?be?found?in?the?“doc/mrouted-LINCESE“?file.
**
*/
#include?“defs.h“
/*?the?code?below?implements?a?callout?queue?*/
static?int?id?=?0;
static?struct?timeOutQueue??*queue?=?0;?/*?pointer?to?the?beginning?of?timeout?queue?*/
struct?timeOutQueue?{
????struct?timeOutQueue????*next;???//?Next?event?in?queue
????int?????????????????????id;??
????cfunc_t?????????????????func;???//?function?to?call
????void????????????????????*data;??//?Data?for?function
????int?????????????????????time;???//?Time?offset?for?next?event
};
//?Method?for?dumping?the?Queue?to?the?log.
static?void?debugQueue(void);
/**
*???Initializes?the?callout?queue
*/
void?callout_init()?{
????queue?=?NULL;
}
/**
*???Clears?all?scheduled?timeouts...
*/
void?free_all_callouts()?{
????struct?timeOutQueue?*p;
????while?(queue)?{
????????p?=?queue;
????????queue?=?queue->next;
????????free(p);
????}
}
/**
?*?elapsed_time?seconds?have?passed;?perform?all?the?events?that?should
?*?happen.
?*/
void?age_callout_queue(int?elapsed_time)?{
????struct?timeOutQueue?*ptr;
????int?i?=?0;
????for?(ptr?=?queue;?ptr;?ptr?=?queue?i++)?{
????????if?(ptr->time?>?elapsed_time)?{
????????????ptr->time?-=?elapsed_time;
????????????return;
????????}?else?{
????????????elapsed_time?-=?ptr->time;
????????????queue?=?queue->next;
????????????IF_DEBUG?log(LOG_DEBUG?0?“About?to?call?timeout?%d?(#%d)“?ptr->id?i);
????????????if?(ptr->func)
????????????????ptr->func(ptr->data);
????????????free(ptr);
????????}
????}
}
/**
?*?Return?in?how?many?seconds?age_callout_queue()?would?like?to?be?called.
?*?Return?-1?if?there?are?no?events?pending.
?*/
int?timer_nextTi
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2007-11-17?19:35??igmpproxy
?????目錄??????????0??2007-11-17?19:35??igmpproxy\doc
?????文件???????2323??2005-08-20?21:13??igmpproxy\doc\igmpproxy.8
?????文件???????3887??2005-04-30?03:53??igmpproxy\doc\igmpproxy.conf.5
?????文件???????2517??1995-11-30?06:25??igmpproxy\doc\mrouted-LICENSE
?????文件??????15151??2002-07-08?01:38??igmpproxy\GPL.txt
?????文件????????235??2005-04-30?21:03??igmpproxy\README
?????目錄??????????0??2007-11-17?19:35??igmpproxy\src
?????文件???????6993??2005-05-24?23:49??igmpproxy\src\callout.c
?????文件??????11767??2005-05-24?23:49??igmpproxy\src\config.c
?????文件???????6282??2005-05-24?23:49??igmpproxy\src\confread.c
?????文件???????8378??2005-08-20?20:44??igmpproxy\src\defs.h
?????文件???????8548??2005-05-24?23:49??igmpproxy\src\ifvc.c
?????文件???????9358??2005-05-24?23:49??igmpproxy\src\igmp.c
?????文件??????11158??2005-08-20?20:56??igmpproxy\src\igmpproxy.c
?????文件???????1529??2005-04-30?03:27??igmpproxy\src\igmpproxy.conf
?????文件???????4408??2005-08-20?20:21??igmpproxy\src\kern.c
?????文件???????4301??2005-05-24?23:48??igmpproxy\src\lib.c
?????文件????????597??2005-08-20?20:34??igmpproxy\src\Makefile
?????文件???????3070??2005-08-20?20:54??igmpproxy\src\mcgroup.c
?????文件???????7199??2005-05-24?23:48??igmpproxy\src\mroute-api.c
?????文件???????7124??2005-05-24?23:48??igmpproxy\src\request.c
?????文件??????22143??2005-08-20?20:46??igmpproxy\src\rttable.c
?????文件???????3129??2005-05-24?23:48??igmpproxy\src\syslog.c
?????文件???????2268??2005-08-20?20:35??igmpproxy\src\udpsock.c
?????文件???????1446??2005-08-20?21:06??igmpproxy\src\version.h
-----------?---------??----------?-----??----
???????????????143811????????????????????26
- 上一篇:憶容器模型設計
- 下一篇:網上書店 用例圖 活動圖 類圖 UML
評論
共有 條評論