Implemented MIP stack http_fetch()

This approach used tuntap driver for Linux/Unices
This commit is contained in:
Jean-Francois Simon committed 2022-11-21 15:32:45 +01:00
1 parent d958ec2ac8
commit 0d7bbc51e7
4 files changed
+213 -8

No files matched your search

+6 -1
View File
@@ -478,7 +478,7 @@ static size_t tx_tcp(struct mip_if *ifp, uint32_t dst_ip, uint8_t flags,
struct ip *ip = tx_ip(ifp, 6, ifp->ip, dst_ip, sizeof(struct tcp) + len);
struct tcp *tcp = (struct tcp *) (ip + 1);
memset(tcp, 0, sizeof(*tcp));
memmove(tcp + 1, buf, len);
if (buf != NULL && len) memmove(tcp + 1, buf, len);
tcp->sport = sport;
tcp->dport = dport;
tcp->seq = seq;
@@ -845,6 +845,11 @@ void mip_init(struct mg_mgr *mgr, struct mip_if *ifp) {
}
}
void mip_free(struct mip_if * ifp) {
free((char *)ifp->rx.ptr);
free((char *)ifp->tx.ptr);
}
int mg_mkpipe(struct mg_mgr *m, mg_event_handler_t fn, void *d, bool udp) {
(void) m, (void) fn, (void) d, (void) udp;
MG_ERROR(("Not implemented"));
+1
View File
@@ -50,6 +50,7 @@ struct mip_if {
};
void mip_init(struct mg_mgr *, struct mip_if *);
void mip_free(struct mip_if *);
extern struct mip_driver mip_driver_stm32;
extern struct mip_driver mip_driver_enc28j60;