chord.h
来自「基于DHT的对等协议」· C头文件 代码 · 共 83 行
H
83 行
#ifndef _CHORD_H_#define _CHORD_H_/* * * Copyright (C) 2000 Frans Kaashoek (kaashoek@lcs.mit.edu) * Copyright (C) 2001 Frans Kaashoek (kaashoek@lcs.mit.edu) and * Frank Dabek (fdabek@lcs.mit.edu). * * 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, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */#include <arpc.h>#include <crypt.h>#include <vec.h>#include <qhash.h>#ifdef DMALLOC#include <dmalloc.h>#endif#include <id_utils.h>#include <chord_prot.h>#include <transport_prot.h>#include <misc_utils.h>typedef int cb_ID;class chord;class vnode;class route_factory;class chord;class location;class locationtable;class rpc_manager;class finger_table;struct user_args;typedef vec<ptr<location> > route; //route: 一系列 pointer to locationclass route_iterator; //route 迭代器//这一系列的回调函数什么用???typedef callback<bool, chord_node, int>::ptr cbtmo_t;typedef callback<void,ptr<vnode>,chordstat>::ref cbjoin_t;typedef callback<void,chord_node,chordstat>::ref cbchordID_t;typedef callback<void,vec<chord_node>,chordstat>::ref cbchordIDlist_t;typedef callback<void,vec<chord_node>,route,chordstat>::ref cbroute_t;typedef callback<void, user_args *>::ref cbdispatch_t;typedef callback<void,chordstat>::ptr cbping_t;typedef callback<void, bool>::ref cbupcalldone_t;typedef callback<void, int, void *, cbupcalldone_t>::ref cbupcall_t; typedef callback<ref<vnode>, ref<chord>, ref<rpc_manager>, ref<location> >::ref vnode_producer_t;typedef callback<ptr<finger_table>, ptr<vnode>, ptr<locationtable> >::ref cb_fingertableproducer_t; //内联函数??forgotinline const strbuf &strbuf_cat (const strbuf &sb, chordstat status) { return rpc_print (sb, status, 0, NULL, NULL); //???rpc_print 用于打印吗
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?