-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkademlua.h
More file actions
43 lines (35 loc) · 873 Bytes
/
kademlua.h
File metadata and controls
43 lines (35 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
//#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
/*
kademlua.h
(c) 2009, Michael Meier
*/
struct eventstate {
lua_State *mstate;
int sock;
u_int16_t port;
struct sockaddr_in mysockaddr;
int readfromstdin;
};
void notdecoded(lua_State *L);
int recvpacket(lua_State *L, struct eventstate *estate);
int getevent(lua_State *L);
int sha1(lua_State *L);
char nibbledigit(char digit);
int tohex(lua_State *L);
char fromdigit(char digit);
int fromhex(lua_State *L);
int xor(lua_State *L);
int getbucketno(lua_State *L);
int ectime(lua_State *L);
void pushargv(lua_State *L, int argc, char **argv);
int initestate(lua_State *L);
struct eventstate *init(int argc, char **argv);
static const struct luaL_reg eclib[];