SANEI 1.3.1.72-4c77c
sanei_udp.h
1/* sane - Scanner Access Now Easy.
2 * Copyright (C) 2007 Tower Technologies
3 * Author: Alessandro Zummo <a.zummo@towertech.it>
4 * This file is part of the SANE package.
5 *
6 * This file is in the public domain. You may use and modify it as
7 * you see fit, as long as this copyright message is included and
8 * that there is an indication as to what modifications have been
9 * made (if any).
10 *
11 * SANE is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.
14 *
15 * Header file for UDP/IP communications.
16 */
17
18#ifndef sanei_udp_h
19#define sanei_udp_h
20
21#include <sane/sane.h>
22
23#ifdef HAVE_WINSOCK2_H
24#include <winsock2.h>
25#endif
26#ifdef HAVE_SYS_SOCKET_H
27#include <netinet/in.h>
28#include <netdb.h>
29#endif
30#ifdef HAVE_SYS_TYPES_H
31#include <sys/types.h>
32#endif
33
34extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
35extern SANE_Status sanei_udp_open_broadcast(int *fdp);
36extern void sanei_udp_close(int fd);
37extern void sanei_udp_set_nonblock(int fd, SANE_Bool nonblock);
38extern ssize_t sanei_udp_write(int fd, const u_char * buf, int count);
39extern ssize_t sanei_udp_read(int fd, u_char * buf, int count);
40extern ssize_t sanei_udp_write_broadcast(int fd, int port, const u_char * buf, int count);
41extern ssize_t sanei_udp_recvfrom(int fd, u_char * buf, int count, char **fromp);
42
43#endif /* sanei_udp_h */