bcast_generated.cc
来自「BCAST Implementation for NS2」· CC 代码 · 共 87 行
CC
87 行
/******************************************************************* Copyright (C) 2004 Thomas Kunz, CRC Canada, BCAST for IPv4. DISTRIBUTED WITH NO WARRANTY, EXPRESS OR IMPLIED. See the GNU Library General Public License (file COPYING in directory application) for conditions of use and redistribution.*********************************************************************/// -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-// Copyright (c) 2001-2003 International Computer Science Institute//// Permission is hereby granted, free of charge, to any person obtaining a// copy of this software and associated documentation files (the "Software")// to deal in the Software without restriction, subject to the conditions// listed in the XORP LICENSE file. These conditions include: you must// preserve this copyright notice, and you cannot mention the copyright// holders in advertising related to the Software without their permission.// The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This// notice is a summary of the XORP LICENSE file; the license in that file is// legally binding.#include "bcast_module.h"#include "libxorp/eventloop.hh"#include "libxorp/exceptions.hh"#include "libxipc/finder_server.hh"#include "libxipc/xrl_std_router.hh"#include "bcast_xifs.hh"#include "bcast_tgt.hh"static const char* g_tgt_name = "bcast_tgt";static const char* g_clnt_name = "bcast_clnt";static voidrun_bcast(){ EventLoop e; FinderServer finder(e); // Configure target for bcast XrlStdRouter tgt_router(e, g_tgt_name, finder.addr(), finder.port()); XrlBcastTarget tgt_target(&tgt_router); // Configure client for bcast XrlRouter clnt_router(e, g_clnt_name, finder.addr(), finder.port()); bool timeout = false; XorpTimer t = e.set_flag_after_ms(2000, &timeout); while (tgt_router.ready() == false && clnt_router.ready() == false) e.run(); if (timeout) { fprintf(stderr, "Timed out connecting to finder\n"); exit(-1); } while (timeout == false) e.run(); // Run bcast fprintf(stderr, "common xif methods\n"); try_common_xif_methods(&e, &clnt_router, tgt_router.name().c_str()); fprintf(stderr, "bcast xif methods\n"); try_bcast_xif_methods(&e, &clnt_router, tgt_router.name().c_str());}int main(int /* argc */, const char* argv[]){ xlog_init(argv[0], 0); xlog_set_verbose(XLOG_VERBOSE_HIGH); xlog_add_default_output(); xlog_start(); try { run_bcast(); } catch (...) { xorp_catch_standard_exceptions(); } xlog_stop(); xlog_exit(); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?