~ubuntu-branches/ubuntu/trusty/mpeg4ip/trusty

« back to all changes in this revision

Viewing changes to lib/rtp/config_unix.h

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2008-01-12 15:59:56 UTC
  • Revision ID: james.westby@ubuntu.com-20080112155956-1vznw5njidvrh649
Tags: upstream-1.6dfsg
ImportĀ upstreamĀ versionĀ 1.6dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  config-unix.h
 
3
 *
 
4
 *  Unix specific definitions and includes
 
5
 *  
 
6
 *  $Revision$
 
7
 *  $Date$
 
8
 *
 
9
 * Copyright (c) 1995-2000 University College London
 
10
 * All rights reserved.
 
11
 *
 
12
 * Redistribution and use in source and binary forms, with or without
 
13
 * modification, is permitted provided that the following conditions 
 
14
 * are met:
 
15
 * 1. Redistributions of source code must retain the above copyright
 
16
 *    notice, this list of conditions and the following disclaimer.
 
17
 * 2. Redistributions in binary form must reproduce the above copyright
 
18
 *    notice, this list of conditions and the following disclaimer in the
 
19
 *    documentation and/or other materials provided with the distribution.
 
20
 * 3. All advertising materials mentioning features or use of this software
 
21
 *    must display the following acknowledgement:
 
22
 *      This product includes software developed by the Computer Science
 
23
 *      Department at University College London
 
24
 * 4. Neither the name of the University nor of the Department may be used
 
25
 *    to endorse or promote products derived from this software without
 
26
 *    specific prior written permission.
 
27
 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
 
28
 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
29
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
30
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
 
31
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
32
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
33
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
34
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
35
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
36
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
37
 * SUCH DAMAGE.
 
38
 */
 
39
 
 
40
#ifndef _WIN32
 
41
#ifndef _CONFIG_UNIX_H
 
42
#define _CONFIG_UNIX_H
 
43
#include "mpeg4ip.h"
 
44
//#include "../../include/mpeg4ip_version.h"
 
45
#include <limits.h>
 
46
#include <sys/types.h>
 
47
#if TIME_WITH_SYS_TIME
 
48
#include <sys/time.h>
 
49
#include <time.h>
 
50
#else
 
51
#if HAVE_SYS_TIME_H
 
52
#include <sys/time.h>
 
53
#else
 
54
#include <time.h>
 
55
#endif
 
56
#endif
 
57
#include <sys/resource.h>
 
58
 
 
59
#include <pwd.h>
 
60
#include <signal.h>
 
61
#include <ctype.h>
 
62
 
 
63
#include <stdio.h>
 
64
#include <stdarg.h>
 
65
#include <memory.h>
 
66
#include <errno.h>
 
67
#include <math.h>
 
68
#include <stdlib.h>   /* abs() */
 
69
#include <string.h>
 
70
#include <fcntl.h>
 
71
#include <sys/types.h>
 
72
#include <sys/socket.h>
 
73
#include <sys/stat.h>
 
74
#include <sys/uio.h>
 
75
#include <netinet/in.h>
 
76
#include <unistd.h>
 
77
#include <sys/param.h>
 
78
#include <sys/fcntl.h>
 
79
#include <sys/ioctl.h>
 
80
#include <netdb.h>
 
81
#include <arpa/inet.h>
 
82
#include <syslog.h>
 
83
#ifdef __APPLE__
 
84
#define NEED_DRAND48
 
85
#define srand48 srand
 
86
#define lrand48 rand() * rand
 
87
#endif
 
88
 
 
89
#ifdef HAVE_SYS_WAIT_H
 
90
#include <sys/wait.h>
 
91
#endif
 
92
#ifndef WEXITSTATUS
 
93
#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
 
94
#endif
 
95
#ifndef WIFEXITED
 
96
#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
 
97
#endif
 
98
 
 
99
#ifdef HAVE_STDINT_H
 
100
#include <stdint.h>
 
101
#endif
 
102
 
 
103
#ifdef HAVE_INTTYPES_H
 
104
#include <inttypes.h>
 
105
#endif
 
106
 
 
107
#ifdef HAVE_STROPTS_H
 
108
#include <stropts.h>
 
109
#endif /* HAVE_STROPTS_H */
 
110
 
 
111
#ifdef HAVE_SYS_FILIO_H
 
112
#include <sys/filio.h>  
 
113
#endif /* HAVE_SYS_FILIO_H */
 
114
 
 
115
#ifdef HAVE_IPv6
 
116
 
 
117
#ifdef HAVE_NETINET6_IN6_H
 
118
/* Expect IPV6_{JOIN,LEAVE}_GROUP in in6.h, otherwise expect                 */
 
119
/* IPV_{ADD,DROP}_MEMBERSHIP in in.h                                         */
 
120
#include <netinet6/in6.h>
 
121
#else
 
122
#ifdef HAVE_NETINET_IP6_H
 
123
#include <netinet/ip6.h>
 
124
#else
 
125
#include <netinet/in.h>
 
126
#endif
 
127
#endif /* HAVE_NETINET_IN6_H */
 
128
 
 
129
#ifndef IPV6_ADD_MEMBERSHIP
 
130
#ifdef  IPV6_JOIN_GROUP
 
131
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
 
132
#else
 
133
#error  No definition of IPV6_ADD_MEMBERSHIP, please report to mm-tools@cs.ucl.ac.uk.
 
134
#endif /* IPV6_JOIN_GROUP     */
 
135
#endif /* IPV6_ADD_MEMBERSHIP */
 
136
 
 
137
#ifndef IPV6_DROP_MEMBERSHIP
 
138
#ifdef  IPV6_LEAVE_GROUP
 
139
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
 
140
#else
 
141
#error  No definition of IPV6_LEAVE_GROUP, please report to mm-tools@cs.ucl.ac.uk.
 
142
#endif  /* IPV6_LEAVE_GROUP     */
 
143
#endif  /* IPV6_DROP_MEMBERSHIP */
 
144
 
 
145
#endif /* HAVE_IPv6 */
 
146
 
 
147
#include <net/if.h>
 
148
 
 
149
#ifndef HAVE_SOCKLEN_T
 
150
typedef unsigned int socklen_t;
 
151
#endif
 
152
 
 
153
typedef u_char  ttl_t;
 
154
typedef int     fd_t;
 
155
 
 
156
#ifndef FALSE
 
157
#define FALSE   0
 
158
#endif
 
159
#ifndef TRUE
 
160
#define TRUE    1
 
161
#endif /* TRUE */
 
162
 
 
163
#define USERNAMELEN     8
 
164
 
 
165
#ifndef max
 
166
#define max(a, b)       (((a) > (b))? (a): (b))
 
167
#endif
 
168
#ifndef min
 
169
#define min(a, b)       (((a) < (b))? (a): (b))
 
170
#endif
 
171
 
 
172
#if 1
 
173
#define ASSERT(x) if ((x) == 0) fprintf(stderr, "%s:%u: failed assertion\n", __FILE__, __LINE__)
 
174
#else
 
175
#include <assert.h>
 
176
#define ASSERT assert
 
177
#endif
 
178
 
 
179
#ifdef Solaris
 
180
#ifdef __cplusplus
 
181
extern "C" {
 
182
#endif
 
183
int gettimeofday(struct timeval *tp, void * );
 
184
int gethostname(char *name, int namelen);
 
185
#ifdef __cplusplus
 
186
}
 
187
#endif
 
188
#endif
 
189
 
 
190
#ifndef EXIT_SUCCESS
 
191
#define EXIT_SUCCESS 0
 
192
#endif /* EXIT_SUCCESS */
 
193
 
 
194
#ifndef EXIT_FAILURE
 
195
#define EXIT_FAILURE 7
 
196
#endif /* EXIT_FAILURE */
 
197
 
 
198
#endif /* _CONFIG_UNIX_H_ */
 
199
#endif /* WIN32 */