fti_xif.cc
来自「BCAST Implementation for NS2」· CC 代码 · 共 791 行 · 第 1/2 页
CC
791 行
XLOG_ERROR("Wrong number of arguments (%u != 7)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0, 0); return; } IPv4Net netmask; IPv4 gateway; string ifname; string vifname; uint32_t metric; uint32_t admin_distance; string protocol_origin; try { a->get("netmask", netmask); a->get("gateway", gateway); a->get("ifname", ifname); a->get("vifname", vifname); a->get("metric", metric); a->get("admin_distance", admin_distance); a->get("protocol_origin", protocol_origin); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0, 0); return; } cb->dispatch(e, &netmask, &gateway, &ifname, &vifname, &metric, &admin_distance, &protocol_origin);}boolXrlFtiV0p2Client::send_lookup_route6( const char* the_tgt, const IPv6& dst, const LookupRoute6CB& cb){ Xrl x(the_tgt, "fti/0.2/lookup_route6"); x.args().add("dst", dst); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_lookup_route6, cb));}/* Unmarshall lookup_route6 */voidXrlFtiV0p2Client::unmarshall_lookup_route6( const XrlError& e, XrlArgs* a, LookupRoute6CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e, 0, 0, 0, 0, 0, 0, 0); return; } else if (a && a->size() != 7) { XLOG_ERROR("Wrong number of arguments (%u != 7)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0, 0); return; } IPv6Net netmask; IPv6 gateway; string ifname; string vifname; uint32_t metric; uint32_t admin_distance; string protocol_origin; try { a->get("netmask", netmask); a->get("gateway", gateway); a->get("ifname", ifname); a->get("vifname", vifname); a->get("metric", metric); a->get("admin_distance", admin_distance); a->get("protocol_origin", protocol_origin); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0, 0); return; } cb->dispatch(e, &netmask, &gateway, &ifname, &vifname, &metric, &admin_distance, &protocol_origin);}boolXrlFtiV0p2Client::send_lookup_entry4( const char* the_tgt, const IPv4Net& dst, const LookupEntry4CB& cb){ Xrl x(the_tgt, "fti/0.2/lookup_entry4"); x.args().add("dst", dst); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_lookup_entry4, cb));}/* Unmarshall lookup_entry4 */voidXrlFtiV0p2Client::unmarshall_lookup_entry4( const XrlError& e, XrlArgs* a, LookupEntry4CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e, 0, 0, 0, 0, 0, 0); return; } else if (a && a->size() != 6) { XLOG_ERROR("Wrong number of arguments (%u != 6)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0); return; } IPv4 gateway; string ifname; string vifname; uint32_t metric; uint32_t admin_distance; string protocol_origin; try { a->get("gateway", gateway); a->get("ifname", ifname); a->get("vifname", vifname); a->get("metric", metric); a->get("admin_distance", admin_distance); a->get("protocol_origin", protocol_origin); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0); return; } cb->dispatch(e, &gateway, &ifname, &vifname, &metric, &admin_distance, &protocol_origin);}boolXrlFtiV0p2Client::send_lookup_entry6( const char* the_tgt, const IPv6Net& dst, const LookupEntry6CB& cb){ Xrl x(the_tgt, "fti/0.2/lookup_entry6"); x.args().add("dst", dst); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_lookup_entry6, cb));}/* Unmarshall lookup_entry6 */voidXrlFtiV0p2Client::unmarshall_lookup_entry6( const XrlError& e, XrlArgs* a, LookupEntry6CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e, 0, 0, 0, 0, 0, 0); return; } else if (a && a->size() != 6) { XLOG_ERROR("Wrong number of arguments (%u != 6)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0); return; } IPv6 gateway; string ifname; string vifname; uint32_t metric; uint32_t admin_distance; string protocol_origin; try { a->get("gateway", gateway); a->get("ifname", ifname); a->get("vifname", vifname); a->get("metric", metric); a->get("admin_distance", admin_distance); a->get("protocol_origin", protocol_origin); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0, 0, 0, 0, 0, 0); return; } cb->dispatch(e, &gateway, &ifname, &vifname, &metric, &admin_distance, &protocol_origin);}boolXrlFtiV0p2Client::send_have_ipv4( const char* the_tgt, const HaveIpv4CB& cb){ Xrl x(the_tgt, "fti/0.2/have_ipv4"); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_have_ipv4, cb));}/* Unmarshall have_ipv4 */voidXrlFtiV0p2Client::unmarshall_have_ipv4( const XrlError& e, XrlArgs* a, HaveIpv4CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e, 0); return; } else if (a && a->size() != 1) { XLOG_ERROR("Wrong number of arguments (%u != 1)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } bool result; try { a->get("result", result); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } cb->dispatch(e, &result);}boolXrlFtiV0p2Client::send_have_ipv6( const char* the_tgt, const HaveIpv6CB& cb){ Xrl x(the_tgt, "fti/0.2/have_ipv6"); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_have_ipv6, cb));}/* Unmarshall have_ipv6 */voidXrlFtiV0p2Client::unmarshall_have_ipv6( const XrlError& e, XrlArgs* a, HaveIpv6CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e, 0); return; } else if (a && a->size() != 1) { XLOG_ERROR("Wrong number of arguments (%u != 1)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } bool result; try { a->get("result", result); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } cb->dispatch(e, &result);}boolXrlFtiV0p2Client::send_get_unicast_forwarding_enabled4( const char* the_tgt, const GetUnicastForwardingEnabled4CB& cb){ Xrl x(the_tgt, "fti/0.2/get_unicast_forwarding_enabled4"); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_get_unicast_forwarding_enabled4, cb));}/* Unmarshall get_unicast_forwarding_enabled4 */voidXrlFtiV0p2Client::unmarshall_get_unicast_forwarding_enabled4( const XrlError& e, XrlArgs* a, GetUnicastForwardingEnabled4CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e, 0); return; } else if (a && a->size() != 1) { XLOG_ERROR("Wrong number of arguments (%u != 1)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } bool enabled; try { a->get("enabled", enabled); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } cb->dispatch(e, &enabled);}boolXrlFtiV0p2Client::send_get_unicast_forwarding_enabled6( const char* the_tgt, const GetUnicastForwardingEnabled6CB& cb){ Xrl x(the_tgt, "fti/0.2/get_unicast_forwarding_enabled6"); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_get_unicast_forwarding_enabled6, cb));}/* Unmarshall get_unicast_forwarding_enabled6 */voidXrlFtiV0p2Client::unmarshall_get_unicast_forwarding_enabled6( const XrlError& e, XrlArgs* a, GetUnicastForwardingEnabled6CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e, 0); return; } else if (a && a->size() != 1) { XLOG_ERROR("Wrong number of arguments (%u != 1)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } bool enabled; try { a->get("enabled", enabled); } catch (const XrlArgs::XrlAtomNotFound&) { XLOG_ERROR("Atom not found"); cb->dispatch(XrlError::BAD_ARGS(), 0); return; } cb->dispatch(e, &enabled);}boolXrlFtiV0p2Client::send_set_unicast_forwarding_enabled4( const char* the_tgt, const bool& enabled, const SetUnicastForwardingEnabled4CB& cb){ Xrl x(the_tgt, "fti/0.2/set_unicast_forwarding_enabled4"); x.args().add("enabled", enabled); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_set_unicast_forwarding_enabled4, cb));}/* Unmarshall set_unicast_forwarding_enabled4 */voidXrlFtiV0p2Client::unmarshall_set_unicast_forwarding_enabled4( const XrlError& e, XrlArgs* a, SetUnicastForwardingEnabled4CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e); return; } else if (a && a->size() != 0) { XLOG_ERROR("Wrong number of arguments (%u != 0)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS()); return; } cb->dispatch(e);}boolXrlFtiV0p2Client::send_set_unicast_forwarding_enabled6( const char* the_tgt, const bool& enabled, const SetUnicastForwardingEnabled6CB& cb){ Xrl x(the_tgt, "fti/0.2/set_unicast_forwarding_enabled6"); x.args().add("enabled", enabled); return _sender->send(x, callback(this, &XrlFtiV0p2Client::unmarshall_set_unicast_forwarding_enabled6, cb));}/* Unmarshall set_unicast_forwarding_enabled6 */voidXrlFtiV0p2Client::unmarshall_set_unicast_forwarding_enabled6( const XrlError& e, XrlArgs* a, SetUnicastForwardingEnabled6CB cb){ if (e != XrlError::OKAY()) { cb->dispatch(e); return; } else if (a && a->size() != 0) { XLOG_ERROR("Wrong number of arguments (%u != 0)", (uint32_t)a->size()); cb->dispatch(XrlError::BAD_ARGS()); return; } cb->dispatch(e);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?