p2p-rpl

Upload: danilo-aleksandrov

Post on 28-Feb-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 p2p-rpl

    1/146

    diff --git a/Makefile.include b/Makefile.includeindex 92e49e5..f50ca43 100644--- a/Makefile.include+++ b/Makefile.include@@ -164,7 +164,7 @@ endef ! -f "# "c$e c$e ".%ec &

    ".l%t ".!a' & ".c'g ".bin ".data c$ntiki".a ".fi!(ae c$e-label%.) ".i*ex".ini &- ".ce ".c$ + ".ce ".c$ ".*ex ". -! -f 8:

    ifndef ;)M t$$l%. :t i%

    aEailable+at *tt'B//%$ucef$ge.net/'$?ect%/c$ntiki/file%/:n%tantA20$ntiki/+Make %ue t$ %elect t*e late%t Ee%i$n.+++xa!'le a''licati$nB+--------------------++*i% di%tibuti$n c$ntain% an exa!'le a''licati$n t*at de!$n%tate% t*e

  • 7/25/2019 p2p-rpl

    2/146

    +$'eati$n $f D2D-D. :t can be launc*ed a% f$ll$(%B++$!'ile t*e fi!(aeB+ cd exa!'le%/i'E6/'l-'2'/+ !ake+

    +$!'ile and un t*e $$?a %i!ulat$B+ cd t$$l%/c$$?a/+ ant un++:n $$?a click Kile G 'en )i!ulati$n and %elect+exa!'le%/i'E6/'l-'2'/'2'-%i!-!ediu!.c%c++lick )tat t$ un t*e %i!ulati$n.++$uble-clicking a n$de %elect% a and$! taget n$de and !ea%ue% t*e$ute+al$ng t*e gl$bal . fte(ad% a D2D $ute di%c$Ee> i% initiated. L$u%*$uld

    +%ee t*e f$!ati$n $f t*e , t*e di%c$Eeed $ute, and t*e ex'iati$n$f t*e+. Kinall> t*e D2D $ute i% !ea%ued. )ub%euent d$uble-click% $n t*e%a!e+n$de tigge t*e tan%!i%%i$n $f ;D data 'acket% al$ng t*e $ute.++;%e t*e %'eed %lide t$ ad?u%t t*e %i!ulati$n %'eed.++n ex'lanati$n $f (*at i% g$ing $n duing t*e %i!ulati$n i% giEen in aEide$+aEailable at *tt'B//c$ntiki-'2'-'l.gf$ge.inia.f/++$ %aEe !e!$>, $nl> t($ te!'$a> % i.e. $ute di%c$Eeie% !a> be

    actiEe+%i!ultane$u%l> can be ad?u%ted b> %etting D

  • 7/25/2019 p2p-rpl

    3/146

    ne( file !$de 100644index 0000000..0bcb66F--- /deE/null+++ b/M-DN@@ -0,0 +1,77 @@+ D D$int t$ D$int D2D exten%i$n

    + eactiEe i%c$Ee> $f D$int-t$-D$int $ute% in $ntiki++ ut*$B Matt*ia% D*ili'' C!att*ia%-'*ili''@g!x.deG+ $ntibut$B !!anuel accelli [email protected]++ DN: ;:+ JJJJJJJJJJJJJJ+++Deeui%ite%B+--------------++ " !%'430-gccB t$ c$!'ile t*e fi!(ae

    + " ecent ?aEa 8IB t$ c$!'ile/un t*e $$?a %i!ulat$++*e ea%ie%t (a> t$ get a %uitable enEi$n!ent i% :n%tant $ntiki, aEitual+!ac*ine i!age t*at c$!e% 'e-in%talled (it* all nece%%a> t$$l%. :t i%aEailable+at *tt'B//%$ucef$ge.net/'$?ect%/c$ntiki/file%/:n%tantA20$ntiki/+Make %ue t$ %elect t*e late%t Ee%i$n.++*e 'atc* c$ntain% an i!'le!entati$n $f t*e D2D exten%i$n f$ D. :ti% ba%ed+$n c$!!it a2073db715f5a1773e4416b3f7Fa7b6ded9dc075 ue ct 4 10B29B402011

    ++0200 but %*$uld al%$ a''l> t$ t*e $fficial elea%e $f $ntiki 2.5.+++Datc*ing t*e $ntiki di%tibuti$nB+----------------------------------++= cl$ne t*e c$ntiki git e'$%it$> alead> d$ne in :n%tant $ntiki+git cl$ne gitB//c$ntiki.git.%$ucef$ge.net/git$$t/c$ntiki/c$ntiki+cd c$ntiki++= ceate a banc* f$ D2D-D+git c*eck$ut -b '2'-'l a2073db715+= if >$uOd 'efe t$ ba%e t*e '2'-'l banc* $n t*e 2.5 elea%e u%eB

    += git c*eck$ut -b '2'-'l 2.5-elea%e++= get inf$!ati$n $n (*at t*e 'atc* c*ange%+git a''l> --%tat '2'-'l.'atc*++= c*eck (*et*e t*ee ae an> c$nflict%+git a''l> --c*eck '2'-'l.'atc*++= actuall> a''l> t*e 'atc*

  • 7/25/2019 p2p-rpl

    4/146

    +git a''l> '2'-'l.'atc*+++un D2D-DB+------------+

    +Dlea%e *aEe a l$$k at M-D2D-D+++eating a Datc*+----------------++= eate ba%e banc* %tating at t*e c$!!it $f t*e !a%te banc*bef$e t*e+= la%t !ege+git c*eck$ut -b '2'-ba%e a2073db715+= *i% can be $!itted if t*e '2'-'l banc* *a% ?u%t been !eged (it*t*e *ead+= $f t*e !a%te banc*. :n t*i% ca%e %i!'l> u%e O!a%teO in%tead $f

    O'2'-ba%eO+= in t*e f$ll$(ing c$!!and%.++git c*eck$ut '2'-'l+= c*eck (*ic* file% *aEe been c*anged/added+git diff --na!e-%tatu% '2'-ba%e..'2'-'l++= eate a %ingle 'atc* (it* all t*e c*ange% %ua%*ed t$get*eB+git diff '2'-ba%e G '2'-'l.'atc*+= *i% l$%e% t*e *i%t$> $f indiEidual c$!!it%, (*ic* i% uite *and> f$a+= elea%e. $ ceate a 'atc* t*at kee'% t*e *i%t$> $f all t*eindiEidual

    += c$!!it% u%eB+= git f$!at-'atc* '2'-ba%e --%td$ut G '2'-'l.'atc*++= Manuall> c*eck t*e 'atc* and e!$Ee un(anted c$ntent e.g. (%n430'latf$!+Ei '2'-'l.'atc*diff --git a/c$e/lib/and$!.c b/c$e/lib/and$!.cindex 91db6c7..1590163 100644--- a/c$e/lib/and$!.c+++ b/c$e/lib/and$!.c@@ -2F,2F +2F,59 @@ " " *i% file i% 'at $f t*e $ntiki $'eating %>%te!.

    "- " @=:dB and$!.c,E 1.5 2010/12/13 16B52B02 dak664 x' + " @=:dB and$!.c,E 1.2 200F/02/10 12B30B57 $liEe%c*!idt x' + "/++/"+ " Mini!al %tandad and$! nu!be geneat$.+ "+ " )i!'le ca''> ): c$!'atible and$! nu!be geneat$ t*at i%

  • 7/25/2019 p2p-rpl

    5/146

    + " g$$d en$ug* f$ u%P+ "+ " Dak, ).I. and I.Q. Mille, 19FFR+ " and$! u!be eneat$%B $$d ne% ae Nad t$ Kind,+ " $!!. $f t*e M, S. 31. $. 10, '' 1192-1201 "/

    =include Tlib/and$!.*T=include T%>%/cl$ck.*T

    -=include C%tdlib.*G+%tatic uint32

  • 7/25/2019 p2p-rpl

    6/146

    + el%e+ etun l$ W M%te!. "- " @=:dB and$!.*,E 1.2 2010/12/13 16B52B02 dak664 x' + " @=:dB and$!.*,E 1.1 2006/06/17 22B41B1F ada!dunkel% x' "/=ifndef

  • 7/25/2019 p2p-rpl

    7/146

    index c36a2bF..1029ef9 100644--- a/c$e/net/neig*b$-inf$.c+++ b/c$e/net/neig*b$-inf$.c@@ -57,6 +57,9 @@ u'date% etun% 37at

    + " lea%t f$ ;M c$n%tant l$%% (it* 100A and ati$% "/+ ifli JJ 37 U+ etun 1R+ V++ ifli GJ F5 U+ etx J 1R+ V el%e ifli GJ 70 U+ etx J 1024 / 4F " li - 3140R

  • 7/25/2019 p2p-rpl

    8/146

    + V el%e U+ etx J 10R+ V+ etun etxR+V+/"----------------------------------------------------------------------

    -----"/E$id neig*b$%c J 'acketbuf

  • 7/25/2019 p2p-rpl

    9/146

    + 'l-$f-etx.c 'l-$f0.c+endifdiff --git a/c$e/net/'l/'l-dag.c b/c$e/net/'l/'l-dag.cindex c304be4..d037d60 100644--- a/c$e/net/'l/'l-dag.c+++ b/c$e/net/'l/'l-dag.c

    @@ -3F,9 +3F,9 @@ " $gic f$ iected c>clic a'*% in D. " " &aut*$ 8$aki! ik%%$n C?$aki!e@%ic%.%eG, ic$la% %ifte%CnEt@%ic%.%eG+ " $ntibut$B Matt*ia% D*ili'' C!att*ia%-'*ili''@g!x.deG "/

    -=include Tc$ntiki.*T=include Tnet/'l/'l-'iEate.*T=include Tnet/ui'.*T@@ -55,25 +55,16 @@

    =define ; ;

  • 7/25/2019 p2p-rpl

    10/146

    @@ -94,15 +F5,29 @@ %tatic 'l-%tatic 'l

  • 7/25/2019 p2p-rpl

    11/146

    ifdag-G!$' JJ D

  • 7/25/2019 p2p-rpl

    12/146

    dag-G'efeed

  • 7/25/2019 p2p-rpl

    13/146

    - dag-Gdefault

  • 7/25/2019 p2p-rpl

    14/146

    + ' J !e!bW'-Gadd, add, %iXe$f'-GaddR

    '-Gdag J dagR '-Gank J di$-GankR- '-GlinkW'-G!c, Wdi$-G!c, %iXe$f'-G!cR

    @@ -330,7 +3F2,FF @@ 'l

  • 7/25/2019 p2p-rpl

    15/146

    + T= c$l$Jgeen&nTR+ V el%e U+ T= c$l$J$ange&nTR+ T= '2'J&nTR+ V+ V el%e U

    + T= ?$inJ&nTR+ ifdag J 'l

  • 7/25/2019 p2p-rpl

    16/146

    + T= Au 1 da%*ed,ed,$Eela>&nT, gl$bal

  • 7/25/2019 p2p-rpl

    17/146

    +=if ; W ;

  • 7/25/2019 p2p-rpl

    18/146

    + D:6W'aent-GaddR+ D:KT&nTR+ ui'

  • 7/25/2019 p2p-rpl

    19/146

    dag J 'l

  • 7/25/2019 p2p-rpl

    20/146

    + D:KTDB adding gl$bal :D adde%% TR+ D:6Wi'addR+ D:KT&nTR+ ui' 'efix inf$!ati$n int$ t*e dag "/+ !e!c'>Wdag-G'efixWdag-Gdag

  • 7/25/2019 p2p-rpl

    21/146

    + D:KTDB Kailed t$ all$cate D2D exten%i$n f$ $b?ectP&nTR+=ifdef ))+ 'ut%T MM '2'TR+=endif /" )) "/+ 'l

  • 7/25/2019 p2p-rpl

    22/146

    +=endif /" ; W ;

  • 7/25/2019 p2p-rpl

    23/146

    /"

    - " Qe ecalculate ank% (*en (e eceiEe feedback f$! t*e %>%te!at*e- " t*an D '$t$c$l !e%%age%. *i% 'ei$dical ecalculati$n i% called- " f$! a ti!e in $de t$ kee' t*e %tack de't* ea%$nabl> l$(.

    + " Qe ecalculate ank% (*en (e eceiEe feedback f$! t*e %>%te! i.e.+ " c*ange% at*e t*an D '$t$c$l !e%%age%. *i% 'ei$dicalecalculati$n+ " i% called f$! a ti!e in $de t$ kee' t*e %tack de't* ea%$nabl>l$(.+ "+ " ank e-caclulati$n i% $nl> d$ne f$ t*e gl$bal , becau%e t*el$cal %+ " f$! t*e D2D exten%i$n ae $nl> u'dated f$! inc$!ing :% a%$''$%ed t$+ " %>%te! feedback. *i% i% becau%e feedback-tiggeed ecalculati$n($uld

    + " euie %t$ing t*e (*$le $ute di%c$Ee> : inf$!ati$n in'aticula+ " t*e %$uce $ute $'ti$n f$ eEe> neig*b$. "/- dag J 'l

  • 7/25/2019 p2p-rpl

    24/146

    +=if Q:N

  • 7/25/2019 p2p-rpl

    25/146

    ifdag JJ ; U /" 8$in t*e fi%t '$%%ible $f t*i% D in%tance. "/ ifdi$-Gank PJ :K::

  • 7/25/2019 p2p-rpl

    26/146

    + " 'aent (a% c*anged in 'l $nl> $ccu%in+ " %i!ulati$n%. *eef$e $nl> incea%e t*e edundanc> c$unteif (e+ " %ent at lea%t $ne : afte t*e la%t ti!e e%et. "/+ D:KT$iginat$B Au, 'efeed 'aentB Au&nT, '-Gadd.uFZ15[,dag-G'efeed

  • 7/25/2019 p2p-rpl

    27/146

    + //ifdag-Gdi$

  • 7/25/2019 p2p-rpl

    28/146

    + " C!att*ia%-'*ili''@g!x.deG "/

    =include Tnet/tc'i'.*T@@ -54,13 +55,26 @@=include C%ting.*G

    =define ; ;

  • 7/25/2019 p2p-rpl

    29/146

    +/"---------------------------------------------------------------------------"/+//=if ; W ;

  • 7/25/2019 p2p-rpl

    30/146

    +!e!%etWdi$, 0, %iXe$fdi$R

    -- di$.dag

  • 7/25/2019 p2p-rpl

    31/146

    + " t*e '$ce%%ing n$de. :f t*ee ae :% (it* inEalid :% it i% Ee>likel>+ " t*at t*ee ae al%$ :% (it* c$u'ted data in le%% $bE$iu%field%. "/+ ifdi$.dag

  • 7/25/2019 p2p-rpl

    32/146

    - di$.!c.$b?.eneg>.flag% J buffeZi + 6[R- di$.!c.$b?.eneg>.eneg>'eB Au&nT,un%igneddi$.!c.t>'eR- etunR

    + /" ne !etic $'ti$n !a> *aEe !ulti'le !etic c$ntaine% "/+ f$? J i + 2R ? C i + lenR ? +J !c

    + di$.!c.t>'e J buffeZ?[R+ di$.!c.flag% J buffeZ? + 1[ CC 1R+ di$.!c.flag% ]J buffeZ? + 2[ GG 7R+ di$.!c.agg J buffeZ? + 2[ GG 4 W 0x3R+ di$.!c.'ec J buffeZ? + 2[ W 0xfR+ di$.!c.lengt* J buffeZ? + 3[R++ ifdi$.!c.t>'e JJ D'e JJ D

  • 7/25/2019 p2p-rpl

    33/146

    + D:KTDB ;n*andled M t>'eB Au&nT,un%igneddi$.!c.t>'eR+ etunR+ V+ V V

    beakR ca%e D- di$.de%tinati$nWdi$.de%tinati$n

    - D

  • 7/25/2019 p2p-rpl

    34/146

    - di$.dag+ dcf.di$

  • 7/25/2019 p2p-rpl

    35/146

    + D:KTDB Multi'le $ute di%c$Ee> $'ti$n%&nTR+ D

    + /" :gn$e e!'t> adde%% %l$t% "/+ d$.add'e in :B Au&nT, un%igned%ub$'t'eR@@ -360,13 +459,75 @@ di$

  • 7/25/2019 p2p-rpl

    36/146

    + D

  • 7/25/2019 p2p-rpl

    37/146

    + V+=endif /" Q:N d$ t*e $ntiki gu>% incea%e t*e ) (it* eEe> :\ "/+=if Q:N.eneg>'eAu&nT,- un%igneddag-G!c.t>'eR+ un%igneddag-G!c.t>'eR etunR V V

    +=if Q:N

  • 7/25/2019 p2p-rpl

    38/146

    + buffeZ'$%++[ J dag-G'2'-Gc$n%t.t>'eR+ buffeZ'$%++[ J dag-G'2'-Gc$n%t.flag% GG 1R+ buffeZ'$%[ J dag-G'2'-Gc$n%t.flag% W 1 CC 7R+ buffeZ'$%[ J dag-G'2'-Gc$n%t.agg CC 4R+ buffeZ'$%++[ ]J dag-G'2'-Gc$n%t.'ecR+ ifdag-G'2'-Gc$n%t.t>'e JJ D %tatic and+ " unc*anging (it*in t*e , t*eef$e it i% n$t nece%%a> t$include in+ " eEe> :.+ "/+=if 1 /" l(a>% add a c$nfiguati$n $'ti$n. "/ buffeZ'$%++[ J D

  • 7/25/2019 p2p-rpl

    39/146

    +=if Q:N $'ti$n. "/+ '$% +J (ite

  • 7/25/2019 p2p-rpl

    40/146

    /"---------------------------------------------------------------------------"/+=if D

  • 7/25/2019 p2p-rpl

    41/146

    etunR@@ -6F4,6 +929,12 @@ da$te%&nT, dag-Gin%tance

  • 7/25/2019 p2p-rpl

    42/146

    + !e!c'>uintF

    + V++ /" $!'ae taget adde%% "/+ ifui'

  • 7/25/2019 p2p-rpl

    43/146

    + /" eneate M e'l> "/+ D

  • 7/25/2019 p2p-rpl

    44/146

    + V+ next*$' J W.tagetR+ V el%e U+ /" M taEel% al$ng N$'-b>-*$' $ute "/+ dag J 'l

  • 7/25/2019 p2p-rpl

    45/146

    + ui'

  • 7/25/2019 p2p-rpl

    46/146

    + /" Mea%ue!ent b?ect "/+ iftaget JJ ; U+ D:KTDB :nEalid taget adde%%, unable t$ %end MP&nTR+ etunR+ V+

    + !$

  • 7/25/2019 p2p-rpl

    47/146

    + next*$' J W*b*t-Gnext*$'R+ /" :f t*e in%tance : i% l$cal, t*an t*e : !u%t be $ugl$bal+ " adde%%, $t*e(i%e (e cann$t !ea%ue t*i% $ute. "/+ if*b*t-G%tate.in%tance W D-*$' $ute d$e% n$t bel$ng t$ !e,unable t$ %end MP&nTR+ etunR+ V+ /" Qe !ea%ue a *$'-b>-*$' $ute (it* l$cal in%tance :. "/+ D

  • 7/25/2019 p2p-rpl

    48/146

    + /" ;nica%t t*e !e%%age t$ t*e next *$' "/+ D:KTDB )ending M&nTR+ /"'int

    + !e!c'>;:D

  • 7/25/2019 p2p-rpl

    49/146

    + D

  • 7/25/2019 p2p-rpl

    50/146

    + if'$% GJ buffeWnext*$', d$daguintF

  • 7/25/2019 p2p-rpl

    51/146

    + /" )t$e t*e %$uce $ute c$ntained in t*e "/+ 'l

  • 7/25/2019 p2p-rpl

    52/146

    ++ /" Qe ae an inte!ediate n$de "/+ /" ec$!'e%% adde%% at '$%iti$n M "/+ !e!c'>Wnext*$', d$daguintFWnext*$', d$daguintF i% n$t i!'le!ented $ d$e% n$t ($k. "/+ ui'

  • 7/25/2019 p2p-rpl

    53/146

    ++=ifdef ))+ 'intfTD2D TR+ 'int6addd$dag

  • 7/25/2019 p2p-rpl

    54/146

    + /" lea e! field "/+ buffeZ'$% + 3[ WJ #D

  • 7/25/2019 p2p-rpl

    55/146

    + ifnb J ui'

  • 7/25/2019 p2p-rpl

    56/146

    + /" Q*en t*i% functi$n etun% and ui' V el%e U- ank

  • 7/25/2019 p2p-rpl

    57/146

    =endif /" D

    CnEt@%ic%.%eG+ " $ntibut$B Matt*ia% D*ili'' C!att*ia%-'*ili''@g!x.deG "/

    =include Tnet/'l/'l-'iEate.*T@@ -50,6 +51,7 @@ %tatic E$id e%et'l

  • 7/25/2019 p2p-rpl

    58/146

    +%tatic int '2''e J D adEeti%ed. "/+%tatic int+'2'

  • 7/25/2019 p2p-rpl

    59/146

    + if' PJ ; U+ di$ig*t c 2011, :n%titut ati$nal de ec*ec*e en :nf$!atiue eten+ " ut$!atiue ::+ " ll ig*t% e%eEed.+ "

    + " edi%tibuti$n and u%e in %$uce and bina> f$!%, (it* $ (it*$ut+ " !$dificati$n, ae 'e!itted '$Eided t*at t*e f$ll$(ing c$nditi$n%+ " ae !etB+ " 1. edi%tibuti$n% $f %$uce c$de !u%t etain t*e ab$Ee c$'>ig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e.+ " 2. edi%tibuti$n% in bina> f$! !u%t e'$duce t*e ab$Ee c$'>ig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e int*e+ " d$cu!entati$n and/$ $t*e !ateial% '$Eided (it* t*edi%tibuti$n.+ " 3. eit*e t*e na!e $f t*e :n%titute n$ t*e na!e% $f it%c$ntibut$%+ " !a> be u%ed t$ end$%e $ '$!$te '$duct% deiEed f$! t*i%

    %$ft(ae+ " (it*$ut %'ecific 'i$ (itten 'e!i%%i$n.+ "+ " N:) )KQ :) DS: L N :):; :;) __) :)OO+ " L D)) :MD: Q:), :;:, ; :M: , N+ " :MD: Q:) K MN::L K:)) K D:;D;D)

  • 7/25/2019 p2p-rpl

    60/146

    + " :):M. : S )N N :):; :;) :+ " K L :, ::, ::, )D:, MDL, )H;:+ " M) :;:, ; :M: , D;M K );):;)

    + " )S:)R )) K ;), , DK:)R ;):)) :;D:+ " NQS ;) L NL K :::L, QNN : ,):+ " :::L, :;: : NQ:) :): : LQL+ " ; K N ;) K N:) )KQ, S :K S:) K N D)):::LK+ " );N M.+ "/+/""+ " &file+ " D D$int t$ D$int D2D exten%i$n.+ "

    + " eactiEe i%c$Ee> $f D$int-t$-D$int $ute% in $( D$(e and $%%>et($k%+ " daft-ietf-$ll-'2'-'l-07+ "+ " &aut*$ Matt*ia% D*ili'' C!att*ia%-'*ili''@g!x.deG+ " $ntibut$B !!anuel accelli [email protected]+ "/++=define ; ;

  • 7/25/2019 p2p-rpl

    61/146

    +'l

  • 7/25/2019 p2p-rpl

    62/146

    + f$i J 0R i C D

  • 7/25/2019 p2p-rpl

    63/146

    +V+/""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/+'l

  • 7/25/2019 p2p-rpl

    64/146

    +=if 0+ 'intfTDB ifeti!e $f D2D TR+ 'int6addW'2'-Gdag-Gdag

  • 7/25/2019 p2p-rpl

    65/146

    +/""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/+uint16

  • 7/25/2019 p2p-rpl

    66/146

    + etun 0R+ V++ dag-Gu%ed J 1R+ dag-G?$ined J 1R+ dag-GEe%i$n J 0R

    + dag-G'efeed

  • 7/25/2019 p2p-rpl

    67/146

    + 'int6addWdag-Gdag'e JJ D

  • 7/25/2019 p2p-rpl

    68/146

    + int a t*e!. "/+ ifdi$-Gc$n%t PJ ; U+ !e!c'>Wdag-G'2'-Gc$n%t, di$-Gc$n%t,%iXe$f'l

    + dag-G'2'-Gc$n%t.t>'e J D

  • 7/25/2019 p2p-rpl

    69/146

    + dag-G'2'-G!ax

  • 7/25/2019 p2p-rpl

    70/146

    + T= eJ)t$e1&nTR+=ifdef ))+ 'ut%T MM %ctTR+=endif /" )) "/+ V el%e U+ %c

  • 7/25/2019 p2p-rpl

    71/146

    + ?++R+ V+V+/""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/+E$id

    +'l

  • 7/25/2019 p2p-rpl

    72/146

    + /" take lifeti!e f$! c$nfiguati$n "/+ %cuintFTR+=endif /" )) "/+ etun ;R+ V+ V+ /" dd t*e link l$cal adde%% $f t*e taget at t*e Ee> end. "/+ /" *i% i% a *ackP (e need link l$cal adde%%e% in t*e %$uce$ute,+ " %ince neig*b$ di%c$Ee> i% n$t i!'le!ented $ d$e% n$t ($k. "/+ !e!c'>Wadd, de%t, 16R+ ui'

  • 7/25/2019 p2p-rpl

    73/146

    + if*b*t PJ ; U+ *b*t-G%tate.in%tance J in%tanceR+ !e!c'>W*b*t-G%tate.d$dagid, d$dagid, 16R+ V+ etun *b*tR+V

    +/""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/+uintF, a !atc*ing$ute+ " c$ntain% t*e : a% $nl> *$'. "/+ ifdi$-Gd$-Gadd

  • 7/25/2019 p2p-rpl

    74/146

    diff --git a/c$e/net/'l/'l-'2'.* b/c$e/net/'l/'l-'2'.*ne( file !$de 100644index 0000000..91e36F4--- /deE/null+++ b/c$e/net/'l/'l-'2'.*@@ -0,0 +1,249 @@

    +/""+ " &addt$g$u' ui'6+ " @U+ "/+/"+ " $'>ig*t c 2011, :n%titut ati$nal de ec*ec*e en :nf$!atiue eten+ " ut$!atiue ::+ " ll ig*t% e%eEed.+ "+ " edi%tibuti$n and u%e in %$uce and bina> f$!%, (it* $ (it*$ut+ " !$dificati$n, ae 'e!itted '$Eided t*at t*e f$ll$(ing c$nditi$n%+ " ae !etB

    + " 1. edi%tibuti$n% $f %$uce c$de !u%t etain t*e ab$Ee c$'>ig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e.+ " 2. edi%tibuti$n% in bina> f$! !u%t e'$duce t*e ab$Ee c$'>ig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e int*e+ " d$cu!entati$n and/$ $t*e !ateial% '$Eided (it* t*edi%tibuti$n.+ " 3. eit*e t*e na!e $f t*e :n%titute n$ t*e na!e% $f it%c$ntibut$%+ " !a> be u%ed t$ end$%e $ '$!$te '$duct% deiEed f$! t*i%%$ft(ae+ " (it*$ut %'ecific 'i$ (itten 'e!i%%i$n.+ "

    + " N:) )KQ :) DS: L N :):; :;) __) :)OO+ " L D)) :MD: Q:), :;:, ; :M: , N+ " :MD: Q:) K MN::L K:)) K D:;D;D)+ " :):M. : S )N N :):; :;) :+ " K L :, ::, ::, )D:, MDL, )H;:+ " M) :;:, ; :M: , D;M K );):;)+ " )S:)R )) K ;), , DK:)R ;):)) :;D:+ " NQS ;) L NL K :::L, QNN : ,

    ):+ " :::L, :;: : NQ:) :): : LQL+ " ; K N ;) K N:) )KQ, S :K S:) K N D)):::LK+ " );N M.+ "/+/""+ " &file

  • 7/25/2019 p2p-rpl

    75/146

    + " D D$int t$ D$int D2D exten%i$n.+ "+ " eactiEe i%c$Ee> $f D$int-t$-D$int $ute% in $( D$(e and $%%>et($k%+ " daft-ietf-$ll-'2'-'l-07+ "

    + " &aut*$ Matt*ia% D*ili'' C!att*ia%-'*ili''@g!x.deG+ " $ntibut$B !!anuel accelli [email protected]+ "/++=ifndef D

  • 7/25/2019 p2p-rpl

    76/146

    +=define D

  • 7/25/2019 p2p-rpl

    77/146

    +=define D

  • 7/25/2019 p2p-rpl

    78/146

    + 'l

  • 7/25/2019 p2p-rpl

    79/146

    +uintF

  • 7/25/2019 p2p-rpl

    80/146

    /" ank $f a Eitual $$t n$de t*at c$$dinate% $$t n$de%. "/=define )

  • 7/25/2019 p2p-rpl

    81/146

    +=endif /" PD

  • 7/25/2019 p2p-rpl

    82/146

    E$id ui'

  • 7/25/2019 p2p-rpl

    83/146

    'l

  • 7/25/2019 p2p-rpl

    84/146

    + dag-Gdi$

  • 7/25/2019 p2p-rpl

    85/146

    /""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/exten ui'

  • 7/25/2019 p2p-rpl

    86/146

    + f$i J 0, i

    + D:KTDB $ %'ace f$ ne( $ute ent>, e!$Eing $ld $ute t$TR+ D:6Wui'

    + V e'-G%tate.leaned

  • 7/25/2019 p2p-rpl

    87/146

    + U+ c$ntinueR+ V

    - 'aent J 'l % eceiEed f$! TR+ D:6Wi'addR+ D:KT&nTR+ ui'- ifdag-G$f-G'aent

  • 7/25/2019 p2p-rpl

    88/146

    /""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/@@ -171,F +221,F @@ 'l

  • 7/25/2019 p2p-rpl

    89/146

    + " t$ t*at 'aent i% included in t*e c$!'ai%$n.+ " etun% an intege le%% t*an, eual t$, $ geate t*an Xe$ if t*e$ute+ " adEeti%ed in t*e : i% f$und, e%'ectiEel>, t$ be ($%e, be eual,$ be+ " bette t*an t*e $ute cuentl> adEeti%ed.

    "/%tuct 'l

    +t>'edef %tuct 'l

  • 7/25/2019 p2p-rpl

    90/146

    @@ -240,11 +260,17 @@ %tuct 'l

  • 7/25/2019 p2p-rpl

    91/146

    ui'

  • 7/25/2019 p2p-rpl

    92/146

    next*$' J W;:D

  • 7/25/2019 p2p-rpl

    93/146

    l$ct J ui'

  • 7/25/2019 p2p-rpl

    94/146

    /" " $'>ig*t c 2006, )(edi%* :n%titute $f $!'ute )cience.@@ -43,6 +44,7 @@=include C%ting.*G=include C%tdlib.*G=include Tlib/and$!.*T

    +=include Tlib/!e!b.*T=include Tnet/ui'-nd6.*T=include Tnet/ui'-d%6.*T=include Tnet/ui'-'acketueue.*T@@ -77,6 +79,F @@ ui'

  • 7/25/2019 p2p-rpl

    95/146

    + uintF

  • 7/25/2019 p2p-rpl

    96/146

    + f$a J li%t

    /"---------------------------------------------------------------------------"/E$idui'

  • 7/25/2019 p2p-rpl

    97/146

    =include Tnet/ui'.*T=include T%>%/%ti!e.*T+=include Tlib/li%t.*T

    /"--------------------------------------------------"/

    /"" $nfiguati$n. K$ all table% eig*b$ cac*e, Defix i%t, $utingable,@@ -F9,6 +90,24 @@=endif=define ;:D

  • 7/25/2019 p2p-rpl

    98/146

    @@ -245,7 +26F,21 @@ t>'edef %tuct 'l in t*e %$uce $uting table "/

    +t>'edef %tuct ui'

  • 7/25/2019 p2p-rpl

    99/146

    + D:KTeceiEed ) f$!TR D:6W;:D

  • 7/25/2019 p2p-rpl

    100/146

    ui' C!duE>@ci%c$.c$!G :DE6 elated c$de+ " &aut*$ Matt*ia% D*ili'' C!att*ia%-'*ili''@g!x.deG )$uce $uting*eade

    "//" " $'>ig*t c 2001-2003, da! unkel%.@@ -92,6 +93,7 @@=el%e=define D:K...=define D:6add+=define 'int6addadd 'intfT A02xA02xBA02xA02xBA02xA02xBA02xA02xBA02xA02xBA02xA02xBA02xA02xBA02xA02x &nT, uF

  • 7/25/2019 p2p-rpl

    101/146

    + uintF

  • 7/25/2019 p2p-rpl

    102/146

    + /" ec$!'e%% adde%% at index ii "/+ c!'+ !e!c'>Wadd

  • 7/25/2019 p2p-rpl

    103/146

    beakR ca%e ;:D

  • 7/25/2019 p2p-rpl

    104/146

    +=endif /" ;:D

  • 7/25/2019 p2p-rpl

    105/146

    + " ut$!atiue ::+ " ll ig*t% e%eEed.+ "+ " edi%tibuti$n and u%e in %$uce and bina> f$!%, (it* $ (it*$ut+ " !$dificati$n, ae 'e!itted '$Eided t*at t*e f$ll$(ing c$nditi$n%+ " ae !etB

    + " 1. edi%tibuti$n% $f %$uce c$de !u%t etain t*e ab$Ee c$'>ig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e.+ " 2. edi%tibuti$n% in bina> f$! !u%t e'$duce t*e ab$Ee c$'>ig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e int*e+ " d$cu!entati$n and/$ $t*e !ateial% '$Eided (it* t*edi%tibuti$n.+ " 3. eit*e t*e na!e $f t*e :n%titute n$ t*e na!e% $f it%c$ntibut$%+ " !a> be u%ed t$ end$%e $ '$!$te '$duct% deiEed f$! t*i%%$ft(ae+ " (it*$ut %'ecific 'i$ (itten 'e!i%%i$n.+ "

    + " N:) )KQ :) DS: L N :):; :;) __) :)OO+ " L D)) :MD: Q:), :;:, ; :M: , N+ " :MD: Q:) K MN::L K:)) K D:;D;D)+ " :):M. : S )N N :):; :;) :+ " K L :, ::, ::, )D:, MDL, )H;:+ " M) :;:, ; :M: , D;M K );):;)+ " )S:)R )) K ;), , DK:)R ;):)) :;D:+ " NQS ;) L NL K :::L, QNN : ,

    ):+ " :::L, :;: : NQ:) :): : LQL+ " ; K N ;) K N:) )KQ, S :K S:) K N D)):::LK+ " );N M.+ "/+/""+ " &file+ " xa!'le *$( t$ u%e t*e :DE6 $uting Neade f$ )$uce $ute% (it*D+ " daft-ietf-6!an-'l-$uting-*eade-03+ "

    + " eneati$n $f :DE6 adde%%e% f$! n$de :% i% *ad-c$ded and euie%+ " t*e !ac adde%% t$ be 02B00B00B00B00B00B00BCn$de-idG t*i% can beac*ieEed b>+ " %etting O=define :

  • 7/25/2019 p2p-rpl

    106/146

    ++=include Tc$ntiki.*T+=include Tlib/and$!.*T+=include T%>%/cti!e.*T+=include Tnet/ui'.*T+=include Tnet/ui'-d%6.*T

    +=include Tnet/ui'-ud'-'acket.*T+=include T%>%/cti!e.*T+=include TdeE/butt$n-%en%$.*T++=include Tnet/net%tack.*T++=include C%tdi$.*G+=include C%ting.*G+=include C%tdlib.*G++=define ;D

  • 7/25/2019 p2p-rpl

    107/146

    + We!$te

  • 7/25/2019 p2p-rpl

    108/146

    + int iR+ uintF

  • 7/25/2019 p2p-rpl

    109/146

    +U+ ui'

  • 7/25/2019 p2p-rpl

    110/146

    +D))

  • 7/25/2019 p2p-rpl

    111/146

    + C'$?ectDJTdi%cadTGZ:I:ti!eG+ Cand$!%eedG123456C/and$!%eedG+ C!$tedela>utt$nC/!$teintefaceG

    +C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>Kla%*C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>$ffeeKile%>%te!C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>>teadi$C/!$teintefaceG

  • 7/25/2019 p2p-rpl

    112/146

    +C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%')eialC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'ebugut'utC/!$teinte

    faceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>e!'eatueC/!$teintefaceG+ C/!$tet>'eG+ C!$teG+ Cbeak'$int% /G+ CintefaceG32.F1557503943F514C/>G+ CXG0.0C/XG+ C/inteface'e'e

  • 7/25/2019 p2p-rpl

    113/146

    + Cbeak'$int% /G+ CintefaceG76.71996200F43F4C/>G+ CXG0.0C/XG

    + C/inteface'e

  • 7/25/2019 p2p-rpl

    114/146

    + C!$te

  • 7/25/2019 p2p-rpl

    115/146

    + CintefaceG)eial '$tC/intefaceG+ C%c$ll'$%G0,0C/%c$ll'$%G+ C/'lugin

  • 7/25/2019 p2p-rpl

    116/146

    + C'$?ect DJTdi%cadTGZ:I:1C/identifieG+ Cde%ci'ti$nG)k> M$te >'e =%k>1C/de%ci'ti$nG+ C%$uce DJTdi%cadTGZK: J%k>C/c$!!and%G+ Cfi!(ae DJTc$'>TGZK:C/fi!(aeG+ C!$teintefaceG%e.%ic%.c$$?a.inteface%.D$%iti$nC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.inteface%.i!edde%%C/!$teintefaceG+ C!$teintefaceG%e.%ic%.c$$?a.inteface%.:Ddde%%C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.inteface%.M$te2M$teelati$n%C/!$teintefaceG+

    C!$teintefaceG%e.%ic%.c$$?a.inteface%.M$tettibute%C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'l$ckC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'M$te:C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>utt$nC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>Kla%*C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>$ffeeKile%>%te!C/!$teintefaceG+

    C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>>teadi$C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%')eialC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'ebugut'utC/!$teintefaceG

  • 7/25/2019 p2p-rpl

    117/146

    +C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>e!'eatueC/!$teintefaceG+ C/!$tet>'eG+ C!$teG+ Cbeak'$int% /G

    + CintefaceG129.99652346297373C/>G+ CXG0.0C/XG+ C/inteface'e'e

  • 7/25/2019 p2p-rpl

    118/146

    + Cinteface'e'e'e

  • 7/25/2019 p2p-rpl

    119/146

    + CXG0.0C/XG+ C/inteface'e'e'e

  • 7/25/2019 p2p-rpl

    120/146

    + CxG37.57345F59964F205C/xG+ C>G141.390F0955F6603C/>G+ CXG0.0C/XG+ C/inteface'e'e'e

  • 7/25/2019 p2p-rpl

    121/146

    + CintefaceG6F.697F14543091FC/>G+ CXG0.0C/XG+ C/inteface'e'e'e

  • 7/25/2019 p2p-rpl

    122/146

    + C!$teG+ Cbeak'$int% /G+ CintefaceG121.115461F15259FFC/>G

    + CXG0.0C/XG+ C/inteface

  • 7/25/2019 p2p-rpl

    123/146

    + C%c$ll'$%G0,0C/%c$ll'$%G+ C/'lugin

  • 7/25/2019 p2p-rpl

    124/146

    + Cl$g$ut'utG40000C/l$g$ut'utG+ C/eEent%G+ C!$tet>'eG+ %e.%ic%.c$$?a.!%'!$te.)k>M$te>'e+ CidentifieG%k>1C/identifieG+ Cde%ci'ti$nG)k> M$te >'e =%k>1C/de%ci'ti$nG

    + C%$uce DJTdi%cadTGZK: J%k>C/c$!!and%G+ Cfi!(ae DJTc$'>TGZK:C/fi!(aeG+ C!$teintefaceG%e.%ic%.c$$?a.inteface%.D$%iti$nC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.inteface%.i!edde%%C/!$teintefaceG+ C!$teintefaceG%e.%ic%.c$$?a.inteface%.:Ddde%%C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.inteface%.M$te2M$teelati$n%C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.inteface%.M$tettibute%C/!$teintefaceG+

    C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'l$ckC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'M$te:C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>utt$nC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>Kla%*C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>$ffeeKile%>%te!C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>>teadi$C/!$teintefaceG

    +C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%')eialC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'ebugut'utC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>e!'eatueC/!$teintefaceG+ C/!$tet>'eG+ C!$teG+ Cbeak'$int% /G

    + CintefaceG11.59F70F472266114C/>G+ CXG0.0C/XG+ C/inteface

  • 7/25/2019 p2p-rpl

    125/146

    + C/inteface'e1C/!$tet>'e'e'e'e

  • 7/25/2019 p2p-rpl

    126/146

    + %e.%ic%.c$$?a.!%'!$te.inteface%.M%'M$te:+ CidG5C/idG+ C/inteface'e1C/!$tet>'e'e'e'e

  • 7/25/2019 p2p-rpl

    127/146

    + C/inteface

  • 7/25/2019 p2p-rpl

    128/146

    + C*eig*tG409C/*eig*tG+ Cl$cati$n

  • 7/25/2019 p2p-rpl

    129/146

    + C'$?ect DJTdi%cadTGZ:I:ti!eG-13C/dela>ti!eG+ Cand$!%eedG123456C/and$!%eedG+ C!$tedela>utt$nC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>Kla%*C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>$ffeeKile%>%te!C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>>teadi$C/!$teintefaceG

  • 7/25/2019 p2p-rpl

    130/146

    +C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%')eialC/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>C/!$teintefaceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.M%'ebugut'utC/!$teinte

    faceG+C!$teintefaceG%e.%ic%.c$$?a.!%'!$te.inteface%.)k>e!'eatueC/!$teintefaceG+ C/!$tet>'eG+ C!$teG+ Cbeak'$int% /G+ CintefaceG11.59F70F472266114C/>G+ CXG0.0C/XG+ C/inteface'e'e

  • 7/25/2019 p2p-rpl

    131/146

    + Cbeak'$int% /G+ CintefaceG76.71996200F43F4C/>G+ CXG0.0C/XG

    + C/inteface'e

  • 7/25/2019 p2p-rpl

    132/146

    + C!$te

  • 7/25/2019 p2p-rpl

    133/146

    + CintefaceG)eial '$tC/intefaceG+ C%c$ll'$%G0,0C/%c$ll'$%G+ C/'luginig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e.+ " 2. edi%tibuti$n% in bina> f$! !u%t e'$duce t*e ab$Ee c$'>ig*t+ " n$tice, t*i% li%t $f c$nditi$n% and t*e f$ll$(ing di%clai!e int*e

    + " d$cu!entati$n and/$ $t*e !ateial% '$Eided (it* t*edi%tibuti$n.+ " 3. eit*e t*e na!e $f t*e :n%titute n$ t*e na!e% $f it%c$ntibut$%+ " !a> be u%ed t$ end$%e $ '$!$te '$duct% deiEed f$! t*i%%$ft(ae+ " (it*$ut %'ecific 'i$ (itten 'e!i%%i$n.+ "+ " N:) )KQ :) DS: L N :):; :;) __) :)OO+ " L D)) :MD: Q:), :;:, ; :M: , N+ " :MD: Q:) K MN::L K:)) K D:;D;D)

    + " :):M. : S )N N :):; :;) :+ " K L :, ::, ::, )D:, MDL, )H;:+ " M) :;:, ; :M: , D;M K );):;)+ " )S:)R )) K ;), , DK:)R ;):)) :;D:+ " NQS ;) L NL K :::L, QNN : ,):

  • 7/25/2019 p2p-rpl

    134/146

    + " :::L, :;: : NQ:) :): : LQL+ " ; K N ;) K N:) )KQ, S :K S:) K N D)):::LK+ " );N M.+ "/

    +/""+ " &file+ " xa!'le *$( t$ u%e t*e D D$int t$ D$int D2D exten%i$n.+ "+ " *i% '$ga! *a% been (itten f$ $$?a and )k> !$te% a% it !ake%*eaE> u%e+ " $f ann$tati$n% and n$de attibute% t$ Ei%ualiXe (*at i% g$ing $n. ut+ " neEet*ele%% it %*$uld un $n eal n$de% a% (ell.+ "+ " Make %ue t$ %et ;

  • 7/25/2019 p2p-rpl

    135/146

    +=define ;M

  • 7/25/2019 p2p-rpl

    136/146

    +U+ T= c$l$J(*ite&nTR+V+/"---------------------------------------------------------------------------"/+%tatic E$id

    +tc'i'

  • 7/25/2019 p2p-rpl

    137/146

    +%et

  • 7/25/2019 p2p-rpl

    138/146

    +D))

  • 7/25/2019 p2p-rpl

    139/146

    + V+ /" eceiEed e'l> f$ D2D $ute !ea%ue!ent "/+ V el%e ifeE JJ 'l

    + %tate J D:R+ V+ /" eceiEed e'l> f$ D2D $ute di%c$Ee> "/+ V el%e ifeE JJ 'l

  • 7/25/2019 p2p-rpl

    140/146

    =ifndef )I

  • 7/25/2019 p2p-rpl

    141/146

    -=define ;:D

  • 7/25/2019 p2p-rpl

    142/146

    + 'iEate )ting att%R+ 'iEate %tatic )t$ke da%*ed)t$ke J ne( a%ic)t$ke1,a%ic)t$ke.Di%tCM$teelati$nG !$teelati$n% J ne(a>i%tCM$teelati$nGR

    @@ -3795,F +3F2F,F @@ 'ublic cla%% ;: extend% b%eEable U " @'aa! %$uce )$uce !$te " @'aa! de%t e%tinati$n !$te

    "/- 'ublic E$id addM$teelati$nM$te %$uce, M$te de%t U- addM$teelati$n%$uce, de%t, nullR+ 'ublic E$id addM$teelati$nM$te %$uce, M$te de%t, )ting att% U+ addM$teelati$n%$uce, de%t, att%, nullR V

    /""

    @@ -3F06,12 +3F39,12 @@ 'ublic cla%% ;: extend% b%eEable U

  • 7/25/2019 p2p-rpl

    143/146

    " @'aa! de%t e%tinati$n !$te " @'aa! c$l$ *e c$l$ t$ u%e (*en Ei%ualiXing t*e !$te elati$n "/- 'ublic E$id addM$teelati$nM$te %$uce, M$te de%t, $l$ c$l$ U+ 'ublic E$id addM$teelati$nM$te %$uce, M$te de%t, )ting att%,$l$ c$l$ U

    if %$uce JJ null ]] de%t JJ null U etunR V e!$EeM$teelati$n%$uce, de%tR /" ;niue elati$n% "/- !$teelati$n%.addne( M$teelati$n%$uce, de%t, c$l$R+ !$teelati$n%.addne( M$teelati$n%$uce, de%t, att%, c$l$R !$teelati$nb%eEable.%et*angednd$tif>R V

    diff --gita/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/inteface%/M$te2M$teelati$n%.?aEab/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/inteface%/M$te2M$teelati$n%.?aEaindex 50943de..551F947 100644

    --- a/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/inteface%/M$te2M$teelati$n%.?aEa+++ b/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/inteface%/M$te2M$teelati$n%.?aEa@@ -150,7 +150,7 @@ 'ublic cla%% M$te2M$teelati$n% extend% M$te:ntefaceU !%g J !%g.%ub%ting0, c$l$:ndex.ti!R V )tingZ[ ag% J !%g.%'litT TR- if ag%.lengt* PJ 3 U+ if ag%.lengt* C 3 U etunR V

    @@ -162,6 +162,10 @@ 'ublic cla%% M$te2M$teelati$n% extend%

    M$te:nteface U etunR V )ting %tate J ag%Z2[R+ )ting att% J nullR+ if ag%.lengt* GJ 4 U+ att% J ag%Z3[R+ V

    /" $cate de%tinati$n !$te "/

    /" ;%e i!e adde%% inteface in%tead $f !$te :\ "/@@ -1F1,7 +1F5,7 @@ 'ublic cla%% M$te2M$teelati$n% extend% M$te:ntefaceU

    etunR V elati$n%.addde%tinati$nM$teR- gui.addM$teelati$n!$te, de%tinati$nM$te,dec$de$l$c$l$a!eR+ gui.addM$teelati$n!$te, de%tinati$nM$te, att%,dec$de$l$c$l$a!eR V el%e U elati$n%.e!$Eede%tinati$nM$teR

  • 7/25/2019 p2p-rpl

    144/146

    gui.e!$EeM$teelati$n!$te, de%tinati$nM$teRdiff --git a/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/Si%ualiXe.?aEab/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/Si%ualiXe.?aEaindex 4a65f34..2470a49 100644--- a/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/Si%ualiXe.?aEa+++ b/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/Si%ualiXe.?aEa

    @@ -41,6 +41,7 @@ i!'$t ?aEa.a(t.M$u%e:nf$Ri!'$t ?aEa.a(t.D$intRi!'$t ?aEa.a(t.D$l>g$nRi!'$t ?aEa.a(t.endeingNint%R+i!'$t ?aEa.a(t.)t$keRi!'$t ?aEa.a(t.datatan%fe.ataKlaE$Ri!'$t ?aEa.a(t.datatan%fe.an%feableRi!'$t ?aEa.a(t.datatan%fe.;n%u''$tedKlaE$xce'ti$nR@@ -411,6 +412,9 @@ 'ublic cla%% Si%ualiXe extend% Si%Dlugin U if e.i%D$'u'igge U *andleD$'u'eue%te.getD$int.x, e.getD$int.>R V+ el%e if e.getlick$unt JJ 2 U

    + *andle$ublelicke.getD$int.x, e.getD$int.>R+ V

    *andleM$u%eM$Eee, tueR

    e'aintR@@ -611,6 +615,15 @@ 'ublic cla%% Si%ualiXe extend% Si%Dlugin U Ei%ualiXe)kin%.e!$Ee%kinR V

    + 'iEate E$id *andle$ublelickfinal int x, final int > U+ final M$teZ[ !$te% J findM$te%tD$%iti$nx, >R+ if !$te% PJ null WW !$te%.lengt* G 0 U+ f$ final M$te !$te B !$te% U

    + !$te.get:nteface%.getutt$n.clickutt$nR+ V+ V+ V+ 'iEate E$id *andleD$'u'eue%tfinal int x, final int > U 8D$'u'Menu !enu J ne( 8D$'u'MenuR !enu.addne( 8abelT)elect acti$nBTR@@ -F50,6 +F63,7 @@ 'ublic cla%% Si%ualiXe extend% Si%Dlugin U M$teZ[ allM$te% J %i!ulati$n.getM$te%R

    /" Daint !$te elati$n% "/

    + )t$ke default)t$ke J a'*ic%2g.get)t$keR

    M$teelati$nZ[ elati$n% J %i!ulati$n.get;:.getM$teelati$n%R f$ M$teelati$n B elati$n% U D$%iti$n %$uceD$% J .%$uce.get:nteface%.getD$%iti$nR@@ -F5F,9 +F72,27 @@ 'ublic cla%% Si%ualiXe extend% Si%Dlugin U D$int %$uceD$int J tan%f$!D$%iti$n$Dixel%$uceD$%R D$int de%tD$int J tan%f$!D$%iti$n$Dixelde%tD$%R

    - g.%et$l$.c$l$ JJ null \ $l$.black B .c$l$R+ if .i%Eela> U

  • 7/25/2019 p2p-rpl

    145/146

    + g.%et$l$$l$.IR+ a'*ic%2g.%et)t$kedefault)t$keR+ da($(g, %$uceD$int.x, %$uceD$int.>, de%tD$int.x,de%tD$int.>, M, de%tD$int.x,de%tD$int.>, Me%t, x)$uce, >)$uceR

    final int %iXe J FRdiff --gita/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/%kin%/ttibuteSi%ualiXe)kin.?aEab/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/%kin%/ttibuteSi%ualiXe)kin.?aEaindex c1F9aF6..a54c1fc 100644---a/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/%kin%/ttibuteSi%ualiXe)kin.?aEa+++b/t$$l%/c$$?a/?aEa/%e/%ic%/c$$?a/'lugin%/%kin%/ttibuteSi%ualiXe)kin.?aEa

    @@ -129,6 +129,10 @@ 'ublic cla%% ttibuteSi%ualiXe)kin i!'le!ent%Si%ualiXe)kin U etun $l$.R V el%e if c$l$)ting.eual%:gn$ea%eT'inkT U etun $l$.D:IR+ V el%e if c$l$)ting.eual%:gn$ea%eTc>anT U+ etun $l$.LR+ V el%e if c$l$)ting.eual%:gn$ea%eT(*iteT U+ etun $l$.QN:R

  • 7/25/2019 p2p-rpl

    146/146

    V el%e U t> U etun $l$.dec$dec$l$)tingR