<commit_before>#include "p2psim.h"
#include "kademlia.h"
#include "packet.h"
#include <iostream>
using namespace std;

Kademlia::Kademlia(Node *n) : Protocol(n)
{
}

Kademlia::~Kademlia()
{
}

void
Kademlia::join_kademlia(void *x)
{
  Args *a = (Args*) x;
  IPAddress wkn = (IPAddress) atoi(((*a)["wellknown"]).c_str());

  IPAddress myip = ip();
  doRPC(wkn, Kademlia::do_join, &myip, (void*) 0);
}

void
Kademlia::do_join(void *ip, void *ret)
{
  cout << "Kademlia node with ip=" << *((IPAddress*)ip) << " just registered." << endl;
}

void
Kademlia::join(Args *a)
{
  cout << "Node " << ip() << " doing a 10ms wait" << endl;
  delaycb(10, Kademlia::join_kademlia, a);
}

void
Kademlia::leave(Args*)
{
  cout << "Kademlia leave" << endl;
}

void
Kademlia::crash(Args*)
{
  cout << "Kademlia crash" << endl;
}

void
Kademlia::insert_doc(Args*)
{
  cout << "Kademlia insert_doc" << endl;
}

void
Kademlia::lookup_doc(Args*)
{
  cout << "Kademlia lookup_doc" << endl;
}<commit_msg>*** empty log message ***<commit_after>#include "p2psim.h"
#include "kademlia.h"
#include "packet.h"
#include <iostream>
using namespace std;

Kademlia::Kademlia(Node *n) : Protocol(n)
{
}

Kademlia::~Kademlia()
{
}

void
Kademlia::join_kademlia(void *x)
{
  Args *a = (Args*) x;
  IPAddress wkn = (IPAddress) a->uget("wellknown");

  IPAddress myip = ip();
  doRPC(wkn, Kademlia::do_join, &myip, (void*) 0);
}

void
Kademlia::do_join(void *ip, void *ret)
{
  cout << "Kademlia node with ip=" << *((IPAddress*)ip) << " just registered." << endl;
}

void
Kademlia::join(Args *a)
{
  cout << "Node " << ip() << " doing a 10ms wait" << endl;
  delaycb(10, Kademlia::join_kademlia, a);
}

void
Kademlia::leave(Args*)
{
  cout << "Kademlia leave" << endl;
}

void
Kademlia::crash(Args*)
{
  cout << "Kademlia crash" << endl;
}

void
Kademlia::insert(Args*)
{
  cout << "Kademlia insert" << endl;
}

void
Kademlia::lookup(Args*)
{
  cout << "Kademlia lookup" << endl;
}
{'fraction_non_alphanumeric': 0.20277920741121977, 'fraction_numerical': 0.006176016469377252, 'mean_word_length': 4.873111782477341, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5477832', 'n_tokens_mistral': 826, 'n_tokens_neox': 816, 'n_words': 176}