22#define DNODE_TABLE "data/dnode.bin"
155ListDNodeInfo
sort(ListDNodeInfo l);
Buffer DNode_serialize(DNode dnode)
Definition dnode.c:48
DNode DNode_deserialize(Buffer buf)
Deserialize a Buffer into a DNode.
Definition dnode.c:56
ListDNode ListDNode_deserialize(Buffer buf)
Deserialize a Buffer into a List of DNode's.
Definition dnode.c:87
Buffer ListDNode_serialize(ListDNode list)
Serialize a List of DNode's into a Buffer.
Definition dnode.c:82
void print_dnode(DNode dnode)
Print a DNode's data as a tuple.
Definition dnode.c:176
ListDNodeInfo ListDNodeInfo_deserialize(Buffer buf)
Deserialize a Buffer into a List of DNodeInfo's.
Definition dnode.c:36
ListDNodeInfo sort(ListDNodeInfo l)
Sort a ListDNodeInfo depending on the sequence numbers of its entries.
Definition dnode.c:191
ListDNode select_from_dnode(UUID *nid, IPv4 *address, Port *port)
SELECT from the DNode table.
Definition dnode.c:133
ListDNode DNode_get_db(void)
Get the DNode table from the database.
Definition dnode.c:149
void DNode_set_db(ListDNode dnodes)
Write the database with the List of DNode's.
Definition dnode.c:163
Buffer DNodeInfo_serialize(DNodeInfo dinfo)
Serialize a DNodeInfo to a buffer.
void insert_into_dnode(IPv4 address, Port port)
INSERT into the DNode table.
Definition dnode.c:101
ListDNodeInfo insert(ListDNodeInfo l, DNodeInfo a)
Insert a DNodeInfo into a ListDNodeInfo in a sorted fashion.
Definition dnode.c:181
DNodeInfo DNodeInfo_deserialize(Buffer buf)
Deserialize a Buffer into a List of DNodeInfo's.
Definition dnode.c:11
Buffer ListDNodeInfo_serialize(ListDNodeInfo list)
Serialize a ListDNodeInfo to a buffer.
Definition dnode.c:26
uint16_t Port
El puerto de la conexion.
Definition enchufe.h:28
#define DefList(type)
Definition list.h:93
Byte buffer.
Definition lib.h:92
This carries all the necessary information that a chunk should have.
Definition dnode.h:35
DNode dnode
the DNode of the chunk
Definition dnode.h:36
size_t seq
The place in the sequence of chunks where this chunk should be.
Definition dnode.h:38
UUID cid
The UUID of the chunk.
Definition dnode.h:37
Saves the connection data.
Definition dnode.h:27
Port port
Port of where the connection came from.
Definition dnode.h:30
UUID nid
DNode ID (primary key)
Definition dnode.h:28
IPv4 address
Address of where the connection came from.
Definition dnode.h:29
UUID type Layout taken from: https://en.wikipedia.org/wiki/Universally_unique_identifier#Binary_repre...
Definition uuid.h:24
Tipo para un IPv4 Ademas te ayuda convertir entre little endian y big endian.
Definition enchufe.h:33