mirror of
https://github.com/CPunch/Laika.git
synced 2026-01-31 22:03:33 +00:00
Inital commit
lib/ is just [FoxNet](https://git.openpunk.com/CPunch/FoxNet) ported to C99
This commit is contained in:
25
lib/include/lpeer.h
Normal file
25
lib/include/lpeer.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef LAIKA_PEER_H
|
||||
#define LAIKA_PEER_H
|
||||
|
||||
#include "laika.h"
|
||||
#include "lsocket.h"
|
||||
#include "lpacket.h"
|
||||
#include "lpolllist.h"
|
||||
|
||||
struct sLaika_peer {
|
||||
struct sLaika_socket sock;
|
||||
struct sLaika_pollList *pList; /* pollList we're active in */
|
||||
void (*pktHandler)(struct sLaika_peer *peer, LAIKAPKT_ID id);
|
||||
size_t pktSize; /* current pkt size */
|
||||
LAIKAPKT_ID pktID; /* current pkt ID */
|
||||
size_t *pktSizeTable; /* const table to pull pkt size data from */
|
||||
bool setPollOut; /* if EPOLLOUT/POLLOUT is set on sock's pollfd */
|
||||
};
|
||||
|
||||
struct sLaika_peer *laikaS_newPeer(void (*pktHandler)(struct sLaika_peer *peer, LAIKAPKT_ID id), struct sLaika_pollList *pList, size_t *pktSizeTable);
|
||||
void laikaS_freePeer(struct sLaika_peer *peer);
|
||||
|
||||
bool laikaS_handlePeerIn(struct sLaika_peer *peer);
|
||||
bool laikaS_handlePeerOut(struct sLaika_peer *peer);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user