Commit 755e3395 authored by danielinux's avatar danielinux

Added support for raw sockets

parent b218c2b6
......@@ -118,7 +118,7 @@ int pico_socket_icmp4_recvfrom(struct pico_socket *s, void *buf, int len, void *
return len;
}
int pico_socket_icmp4_sendto_check(struct pico_socket *s, void *buf, int len, void *dst, uint16_t remote_port)
int pico_socket_icmp4_sendto_check(struct pico_socket *s, const void *buf, int len, void *dst, uint16_t remote_port)
{
struct pico_icmp4_hdr *hdr;
struct pico_frame *echo;
......
......@@ -146,9 +146,9 @@ int pico_icmp4_ping(char *dst, int count, int interval, int timeout, int size, v
int pico_icmp4_ping_abort(int id);
struct pico_socket *pico_icmp4_socket_open(void);
void pico_icmp4_socket_close(struct pico_socket *s);
int pico_socket_icmp4_sendto_check(struct pico_socket *s, void *buf, int len, void *dst, uint16_t remote_port);
struct pico_socket *pico_socket_icmp4_open(void);
int pico_socket_icmp4_close(struct pico_socket *arg);
int pico_socket_icmp4_sendto_check(struct pico_socket *s, const void *buf, int len, void *dst, uint16_t remote_port);
int pico_socket_icmp4_recvfrom(struct pico_socket *s, void *buf, int len, void *orig, uint16_t *remote_port);
int pico_socket_icmp4_bind(struct pico_socket *s, void *addr, uint16_t port);
......
......@@ -461,7 +461,7 @@ int pico_socket_ipv4_sendto(struct pico_socket *s, void *buf, int len, void *dst
return -1;
}
f->transport_len = (uint16_t)(len);
pico_ipv4_frame_push(f, dst, s->proto);
pico_ipv4_frame_push(f, dst, s->proto->proto_number);
return len;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment