Add missing includes for FreeBSD compile
[bcusdk.git] / eibd / examples / common.h
blobd1633db485a9ffbd191f58ec3bcb77740cc05984
1 /*
2 EIB Demo program - common functions
3 Copyright (C) 2005-2007 Martin Koegler <mkoegler@auto.tuwien.ac.at>
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; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <errno.h>
22 #include <unistd.h>
23 #include "eibclient.h"
25 /** unsigned char*/
26 typedef unsigned char uchar;
28 /** print hex dump of a buffer
29 * \param len Length of the buffer
30 * \param data buffer
32 void printHex (int len, uchar * data);
33 /** aborts the program and prints message
34 * \param msg Message (printf like)
36 void die (const char *msg, ...);
37 /** parses a EIB address
38 * \param addr string with the EIB address
39 * \return EIB address
41 eibaddr_t readaddr (const char *addr);
42 /** parses a EIB group address
43 * \param addr string with the EIB address
44 * \return EIB address
46 eibaddr_t readgaddr (const char *addr);
47 /** parses a hex number
48 * \param addr string
49 * \return parsed hex number
51 unsigned readHex (const char *addr);
52 /** parse hex numbers (byte size) out of a comand line
53 * \param buf output buffer
54 * \param size buffer size
55 * \param ac argument count
56 * \param ag argument array
57 * \return parsed bytes
59 int readBlock (uchar * buf, int size, int ac, char *ag[]);
60 /** prints a EIB individual address
61 * \param addr EIB address
63 void printIndividual (eibaddr_t addr);
64 void printGroup (eibaddr_t addr);
66 void parseKey (int *ac, char **ag[]);
67 void auth (EIBConnection *);