-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
224 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
#pragma once | ||
|
||
#include "../addr.h" | ||
#include "../packet/datagram.h" | ||
#include "../storage/packet_buf.h" | ||
#include "../socket.h" | ||
#include "../addr.h" | ||
#include "../storage/packet_buf.h" | ||
#include "vlcb/platform/interface.h" | ||
|
||
#define VLCB_SOCK_DGRAM_BUF(name, size) \ | ||
unsigned char data_##name[sizeof(VlcbPacketDatagram) * size]; \ | ||
VlcbPacketBuf name = \ | ||
#define VLCB_SOCK_DGRAM_BUF(name, size) \ | ||
unsigned char data_##name[sizeof(VlcbPacketDatagram) * size]; \ | ||
VlcbPacketBuf name = \ | ||
vlcb_net_packetbuf_New(data_##name, size, sizeof(VlcbPacketDatagram)); | ||
|
||
typedef struct { | ||
_INTERFACE_IMPLEMENT(IVlcbNetSocket); | ||
VlcbPacketBuf *const rxBuf; | ||
VlcbPacketBuf *const txBuf; | ||
const VlcbNetHwAddr *addr; | ||
} VlcbNetSocketDatagram; | ||
|
||
VlcbNetSocket vlcb_net_sock_dgram_Upcast(VlcbNetSocketDatagram *const sock); | ||
// VlcbNetSocket vlcb_net_sock_dgram_Upcast(VlcbNetSocketDatagram *const sock); | ||
|
||
VlcbNetSocketDatagram vlcb_net_sock_dgram_New(VlcbPacketBuf *const rxBuf, | ||
VlcbPacketBuf *const txBuf); | ||
|
||
VlcbNetSocketDatagram vlcb_net_sock_dgram_New( | ||
VlcbPacketBuf *const rxBuf, VlcbPacketBuf *const txBuf); | ||
VlcbNetSocketErr | ||
vlcb_net_sock_dgram_Send(VlcbNetSocketDatagram *const sock, | ||
const VlcbPacketDatagram *const packet); | ||
VlcbNetSocketErr vlcb_net_sock_dgram_Recv(VlcbNetSocketDatagram *const sock, | ||
VlcbPacketDatagram *const packet); | ||
|
||
VlcbNetSocketErr vlcb_net_sock_dgram_Send(VlcbNetSocketDatagram *const sock, const VlcbPacketDatagram *const packet); | ||
VlcbNetSocketErr vlcb_net_sock_dgram_Recv(VlcbNetSocketDatagram *const sock, VlcbPacketDatagram *const packet); | ||
static inline IVlcbNetSocket *const | ||
vlcb_net_sock_dgram_Upcast(VlcbNetSocketDatagram *const sock) { | ||
return (IVlcbNetSocket *)sock; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.