2 * Milkymist SoC (Software)
3 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __NET_MICROUDP_H
19 #define __NET_MICROUDP_H
21 #define IPTOINT(a, b, c, d) ((a << 24)|(b << 16)|(c << 8)|d)
23 #define MICROUDP_BUFSIZE (5*1532)
25 typedef void (*udp_callback
)(unsigned int src_ip
, unsigned short src_port
, unsigned short dst_port
, void *data
, unsigned int length
);
27 void microudp_start(unsigned char *macaddr
, unsigned int ip
);
28 int microudp_arp_resolve(unsigned int ip
);
29 void *microudp_get_tx_buffer(void);
30 int microudp_send(unsigned short src_port
, unsigned short dst_port
, unsigned int length
);
31 void microudp_set_callback(udp_callback callback
);
32 void microudp_service(void);
34 #endif /* __NET_MICROUDP_H */