Lines Matching defs:igmprt
2 * Fichier main :igmprt - An IGMP Proxy implementation
4 * Fichier : igmprt.c
17 #include "igmprt.h"
843 igmp_router_t* igmprt)
845 igmprt->igmprt_interfaces = NULL;
846 igmprt->igmprt_thr_timer = igmprt->igmprt_thr_input = 0;
847 igmprt->igmprt_flag_timer = 0;
848 igmprt->igmprt_flag_input = 0;
850 igmprt->igmprt_up_socket = socket( AF_INET, SOCK_DGRAM, 0 );
851 if( igmprt->igmprt_up_socket < 0) {
856 igmprt->igmprt_socket = socket(AF_INET, SOCK_RAW, IPPROTO_IGMP);
857 if (igmprt->igmprt_socket < 0)
869 igmprt_destroy(igmp_router_t* igmprt)
875 for (ifp = igmprt->igmprt_interfaces; ifp;) {
881 igmprt_stop(igmprt);
892 igmp_router_t* igmprt,
897 for (ifp = igmprt->igmprt_interfaces; ifp; ifp = ifp->igmpi_next)
910 igmp_router_t* igmprt,
915 for (ifp = igmprt->igmprt_interfaces; ifp; ifp = ifp->igmpi_next)
928 igmp_router_t* igmprt,
934 if ((ifp = igmprt_interface_lookup(igmprt, ifaddr)))
946 igmp_router_t* igmprt,
955 if ((ifp = igmprt_interface_lookup(igmprt, ifaddr)))
959 ifp->igmpi_next = igmprt->igmprt_interfaces;
960 igmprt->igmprt_interfaces = ifp;
972 igmp_router_t* igmprt,
979 if ((ifp = igmprt_interface_lookup(igmprt, ifaddr)))
981 return igmp_interface_group_add(igmprt,ifp, groupaddr);
985 * void igmprt_timergroup(igmp_router_t* igmprt)
990 igmprt_timer(igmp_router_t* igmprt)
1013 for (ifp = igmprt->igmprt_interfaces; ifp; ifp = ifp->igmpi_next) {
1025 igmprt_membership_query(igmprt, ifp, &zero, NULL, 0, 0);
1035 igmprt_timer_group(igmprt,ifp);
1038 igmprt_timer_source(igmprt,ifp);
1040 send_sh_query(igmprt,ifp);
1056 igmp_router_t* igmprt = (igmp_router_t*) arg;
1058 while (igmprt->igmprt_flag_timer) {
1059 igmprt_timer(igmprt);
1073 igmprt_input(igmp_router_t* igmprt, igmp_interface_t* ifp)
1114 n = recvfrom(igmprt->igmprt_socket, ifp->igmpi_buf, ifp->igmpi_bufsize, 0,
1151 ifpi = igmprt_interface_lookup(igmprt, rt_lan);
1153 ifpi = igmprt_interface_lookup(igmprt, rt_wan);
1166 receive_membership_query(igmprt,ifpi,query->igmpq_group,NULL,src.s_addr,0,srsp,IGMP_VERSION_1);
1170 receive_membership_query(igmprt,ifpi,query->igmpq_group,NULL,src.s_addr,0,srsp,IGMP_VERSION_2);
1173 receive_membership_query(igmprt,ifpi,query->igmpq_group,query->igmpq_sources,src.s_addr,query->igmpq_numsrc,srsp,IGMP_VERSION_3);
1182 igmp_interface_membership_report_v12(igmprt,ifpi,src, (igmpr_t*) ptype, igmplen, IGMP_VERSION_1);
1190 igmp_interface_membership_report_v12(igmprt,ifpi,src, (igmpr_t*) ptype, igmplen, IGMP_VERSION_2);
1200 igmp_interface_membership_report_v3(igmprt,ifpi,src,report,sizeof(report));
1207 igmp_interface_leave_group_v2(igmprt,ifpi,src, (igmpr_t*) ptype, igmplen);
1222 igmp_router_t* igmprt = (igmp_router_t*) arg;
1234 /*for (ifp = igmprt->igmprt_interfaces; ifp; ifp = ifp->igmpi_next) {
1240 FD_SET(igmprt->igmprt_socket, &allset);
1241 for (ifp = igmprt->igmprt_interfaces; ifp; ifp = ifp->igmpi_next)
1247 maxfd = (igmprt->igmprt_socket>maxfd)?igmprt->igmprt_socket:maxfd;
1253 while (igmprt->igmprt_flag_input) {
1260 for (ifp = igmprt->igmprt_interfaces; ifp; ifp = ifp->igmpi_next) {
1261 if (FD_ISSET(ifp->igmpi_socket, &rset) || FD_ISSET(igmprt->igmprt_socket,&rset))
1264 igmprt_input(igmprt, ifp);
1273 * void igmprt_start(igmp_router_t* igmprt)
1278 igmprt_start(igmp_router_t* igmprt)
1283 if (igmprt->igmprt_running)
1287 igmprt->igmprt_flag_timer = 1;
1288 igmprt->igmprt_thr_timer = 0;
1289 if ((err = pthread_create(&igmprt->igmprt_thr_timer, NULL,
1290 igmprt_timer_thread, (void*) igmprt)) != 0)
1295 igmprt->igmprt_flag_input = 1;
1296 igmprt->igmprt_thr_input = 0;
1297 if ((err = pthread_create(&igmprt->igmprt_thr_input, NULL,
1298 igmprt_input_thread, (void*) igmprt)) != 0)
1300 igmprt->igmprt_running = 1;
1304 * void igmprt_stop(igmp_router_t* igmprt)
1309 igmprt_stop(igmp_router_t* igmprt)
1315 if (!igmprt->igmprt_running)
1319 igmprt->igmprt_flag_timer = 0;
1320 igmprt->igmprt_flag_input = 0;
1324 igmprt->igmprt_running = 0;
1326 /*if ((ifp = igmprt->igmprt_interfaces))
1329 k_stop_proxy(igmprt->igmprt_socket);
1330 close(igmprt->igmprt_socket);
1341 igmprt_print(igmp_router_t* igmprt)
1345 assert(igmprt != NULL);
1347 for (ifp = igmprt->igmprt_interfaces; ifp; ifp = ifp->igmpi_next)