1 #ifndef __SHAIRPORT_H__
2 #define __SHAIRPORT_H__
3 
4 #include <stdio.h>
5 #include <string.h>
6 #include <unistd.h>
7 #include <openssl/bio.h>
8 #include <openssl/ssl.h>
9 #include <openssl/err.h>
10 #include "socketlib.h"
11 #include <regex.h>
12 #include <sys/types.h>
13 #include <regex.h>
14 #include "ao.h"
15 
16 
17 #define HWID_SIZE 6
18 #define SHAIRPORT_LOG 1
19 
20 #ifndef LOG_INFO
21 #define LOG_INFO     5
22 #endif
23 
24 #ifndef LOG_DEBUG
25 #define LOG_DEBUG    6
26 #endif
27 
28 #define LOG_DEBUG_V  7
29 #define LOG_DEBUG_VV 8
30 
31 struct shairbuffer
32 {
33   char *data;
34   int   current;
35   int   maxsize;
36   int   marker;
37 };
38 
39 struct keyring
40 {
41   char *aeskey;
42   char *aesiv;
43   char *fmt;
44 };
45 
46 struct comms
47 {
48   int  in[2];
49   int  out[2];
50 };
51 
52 struct connection
53 {
54   struct shairbuffer  recv;
55   struct shairbuffer  resp;
56   struct keyring      *keys; // Does not point to malloc'd memory.
57 #ifndef XBMC
58   struct comms        *hairtunes;
59 #endif
60   int                 clientSocket;
61   char                *password;
62 };
63 
64 #ifdef __cplusplus
65 extern "C"
66 {
67 #endif /* __cplusplus */
68 
69 struct printfPtr
70 {
71   int (*extprintf)(const char* msg, size_t msgSize);
72 };
73 
74 int shairport_main(int argc, char **argv);
75 void shairport_exit(void);
76 int shairport_loop(void);
77 int shairport_is_running(void);
78 void shairport_set_ao(struct AudioOutput *ao);
79 void shairport_set_printf(struct printfPtr *funcPtr);
80 
81 #ifdef __cplusplus
82 }
83 #endif /* __cplusplus */
84 
85 #endif
86 
87