1141cc406Sopenharmony_ci/* sane - Scanner Access Now Easy. 2141cc406Sopenharmony_ci * Copyright (C) 2007 Tower Technologies 3141cc406Sopenharmony_ci * Author: Alessandro Zummo <a.zummo@towertech.it> 4141cc406Sopenharmony_ci * This file is part of the SANE package. 5141cc406Sopenharmony_ci * 6141cc406Sopenharmony_ci * This file is in the public domain. You may use and modify it as 7141cc406Sopenharmony_ci * you see fit, as long as this copyright message is included and 8141cc406Sopenharmony_ci * that there is an indication as to what modifications have been 9141cc406Sopenharmony_ci * made (if any). 10141cc406Sopenharmony_ci * 11141cc406Sopenharmony_ci * SANE is distributed in the hope that it will be useful, but WITHOUT 12141cc406Sopenharmony_ci * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13141cc406Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE. 14141cc406Sopenharmony_ci * 15141cc406Sopenharmony_ci * Header file for UDP/IP communications. 16141cc406Sopenharmony_ci */ 17141cc406Sopenharmony_ci 18141cc406Sopenharmony_ci#ifndef sanei_udp_h 19141cc406Sopenharmony_ci#define sanei_udp_h 20141cc406Sopenharmony_ci 21141cc406Sopenharmony_ci#include <sane/sane.h> 22141cc406Sopenharmony_ci 23141cc406Sopenharmony_ci#ifdef HAVE_WINSOCK2_H 24141cc406Sopenharmony_ci#include <winsock2.h> 25141cc406Sopenharmony_ci#endif 26141cc406Sopenharmony_ci#ifdef HAVE_SYS_SOCKET_H 27141cc406Sopenharmony_ci#include <netinet/in.h> 28141cc406Sopenharmony_ci#include <netdb.h> 29141cc406Sopenharmony_ci#endif 30141cc406Sopenharmony_ci#ifdef HAVE_SYS_TYPES_H 31141cc406Sopenharmony_ci#include <sys/types.h> 32141cc406Sopenharmony_ci#endif 33141cc406Sopenharmony_ci 34141cc406Sopenharmony_ciextern SANE_Status sanei_udp_open(const char *host, int port, int *fdp); 35141cc406Sopenharmony_ciextern SANE_Status sanei_udp_open_broadcast(int *fdp); 36141cc406Sopenharmony_ciextern void sanei_udp_close(int fd); 37141cc406Sopenharmony_ciextern void sanei_udp_set_nonblock(int fd, SANE_Bool nonblock); 38141cc406Sopenharmony_ciextern ssize_t sanei_udp_write(int fd, const u_char * buf, int count); 39141cc406Sopenharmony_ciextern ssize_t sanei_udp_read(int fd, u_char * buf, int count); 40141cc406Sopenharmony_ciextern ssize_t sanei_udp_write_broadcast(int fd, int port, const u_char * buf, int count); 41141cc406Sopenharmony_ciextern ssize_t sanei_udp_recvfrom(int fd, u_char * buf, int count, char **fromp); 42141cc406Sopenharmony_ci 43141cc406Sopenharmony_ci#endif /* sanei_udp_h */ 44