~ubuntu-branches/debian/stretch/sflphone/stretch

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.2.1/pjlib/src/pj/ioqueue_linux_kernel.c

  • Committer: Package Import Robot
  • Author(s): Francois Marier, Francois Marier, Mark Purcell
  • Date: 2014-10-18 15:08:50 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20141018150850-2exfk34ckb15pcwi
Tags: 1.4.1-0.1
[ Francois Marier ]
* Non-maintainer upload
* New upstream release (closes: #759576, #741130)
  - debian/rules +PJPROJECT_VERSION := 2.2.1
  - add upstream patch to fix broken TLS support
  - add patch to fix pjproject regression

[ Mark Purcell ]
* Build-Depends:
  - sflphone-daemon + libavformat-dev, libavcodec-dev, libswscale-dev,
  libavdevice-dev, libavutil-dev
  - sflphone-gnome + libclutter-gtk-1.0-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: ioqueue_linux_kernel.c 3553 2011-05-05 06:14:19Z nanang $ */
 
2
/* 
 
3
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
 
4
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 
19
 */
 
20
#include <pj/ioqueue.h>
 
21
#include <pj/os.h>
 
22
#include <pj/log.h>
 
23
#include <pj/list.h>
 
24
#include <pj/pool.h>
 
25
#include <pj/string.h>
 
26
#include <pj/assert.h>
 
27
#include <pj/sock.h>
 
28
 
 
29
#define THIS_FILE   "ioqueue"
 
30
 
 
31
#define PJ_IOQUEUE_IS_READ_OP(op)   \
 
32
        ((op & PJ_IOQUEUE_OP_READ)  || (op & PJ_IOQUEUE_OP_RECV_FROM))
 
33
#define PJ_IOQUEUE_IS_WRITE_OP(op)  \
 
34
        ((op & PJ_IOQUEUE_OP_WRITE) || (op & PJ_IOQUEUE_OP_SEND_TO))
 
35
 
 
36
 
 
37
#if PJ_HAS_TCP
 
38
#  define PJ_IOQUEUE_IS_ACCEPT_OP(op)   (op & PJ_IOQUEUE_OP_ACCEPT)
 
39
#  define PJ_IOQUEUE_IS_CONNECT_OP(op)  (op & PJ_IOQUEUE_OP_CONNECT)
 
40
#else
 
41
#  define PJ_IOQUEUE_IS_ACCEPT_OP(op)   0
 
42
#  define PJ_IOQUEUE_IS_CONNECT_OP(op)  0
 
43
#endif
 
44
 
 
45
#if defined(PJ_DEBUG) && PJ_DEBUG != 0
 
46
#  define VALIDATE_FD_SET               1
 
47
#else
 
48
#  define VALIDATE_FD_SET               0
 
49
#endif
 
50
 
 
51
struct pj_ioqueue_key_t
 
52
{
 
53
    PJ_DECL_LIST_MEMBER(struct pj_ioqueue_key_t)
 
54
    pj_sock_t               fd;
 
55
    pj_ioqueue_operation_e  op;
 
56
    void                   *user_data;
 
57
    pj_ioqueue_callback     cb;
 
58
};
 
59
 
 
60
struct pj_ioqueue_t
 
61
{
 
62
};
 
63
 
 
64
PJ_DEF(pj_ioqueue_t*) pj_ioqueue_create(pj_pool_t *pool, pj_size_t max_fd)
 
65
{
 
66
    return NULL;
 
67
}
 
68
 
 
69
PJ_DEF(pj_status_t) pj_ioqueue_destroy(pj_ioqueue_t *ioque)
 
70
{
 
71
    return 0;
 
72
}
 
73
 
 
74
PJ_DEF(pj_ioqueue_key_t*) pj_ioqueue_register( pj_pool_t *pool,
 
75
                                               pj_ioqueue_t *ioque,
 
76
                                               pj_oshandle_t sock,
 
77
                                               void *user_data,
 
78
                                               const pj_ioqueue_callback *cb)
 
79
{
 
80
    return NULL;
 
81
}
 
82
 
 
83
PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_t *ioque,
 
84
                                           pj_ioqueue_key_t *key)
 
85
{
 
86
    return -1;
 
87
}
 
88
 
 
89
PJ_DEF(void*) pj_ioqueue_get_user_data( pj_ioqueue_key_t *key )
 
90
{
 
91
    return NULL;
 
92
}
 
93
 
 
94
 
 
95
PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioque, const pj_time_val *timeout)
 
96
{
 
97
    return -1;
 
98
}
 
99
 
 
100
PJ_DEF(int) pj_ioqueue_read( pj_ioqueue_t *ioque,
 
101
                             pj_ioqueue_key_t *key,
 
102
                             void *buffer,
 
103
                             pj_size_t buflen)
 
104
{
 
105
    return -1;
 
106
}
 
107
 
 
108
PJ_DEF(int) pj_ioqueue_recvfrom( pj_ioqueue_t *ioque,
 
109
                                 pj_ioqueue_key_t *key,
 
110
                                 void *buffer,
 
111
                                 pj_size_t buflen,
 
112
                                 pj_sockaddr_t *addr,
 
113
                                 int *addrlen)
 
114
{
 
115
    return -1;
 
116
}
 
117
 
 
118
PJ_DEF(int) pj_ioqueue_write( pj_ioqueue_t *ioque,
 
119
                              pj_ioqueue_key_t *key,
 
120
                              const void *data,
 
121
                              pj_size_t datalen)
 
122
{
 
123
    return -1;
 
124
}
 
125
 
 
126
PJ_DEF(int) pj_ioqueue_sendto( pj_ioqueue_t *ioque,
 
127
                               pj_ioqueue_key_t *key,
 
128
                               const void *data,
 
129
                               pj_size_t datalen,
 
130
                               const pj_sockaddr_t *addr,
 
131
                               int addrlen)
 
132
{
 
133
    return -1;
 
134
}
 
135
 
 
136
#if PJ_HAS_TCP
 
137
/*
 
138
 * Initiate overlapped accept() operation.
 
139
 */
 
140
PJ_DEF(int) pj_ioqueue_accept( pj_ioqueue_t *ioqueue,
 
141
                               pj_ioqueue_key_t *key,
 
142
                               pj_sock_t *new_sock,
 
143
                               pj_sockaddr_t *local,
 
144
                               pj_sockaddr_t *remote,
 
145
                               int *addrlen)
 
146
{
 
147
    return -1;
 
148
}
 
149
 
 
150
/*
 
151
 * Initiate overlapped connect() operation (well, it's non-blocking actually,
 
152
 * since there's no overlapped version of connect()).
 
153
 */
 
154
PJ_DEF(pj_status_t) pj_ioqueue_connect( pj_ioqueue_t *ioqueue,
 
155
                                        pj_ioqueue_key_t *key,
 
156
                                        const pj_sockaddr_t *addr,
 
157
                                        int addrlen )
 
158
{
 
159
    return -1;
 
160
}
 
161
#endif  /* PJ_HAS_TCP */
 
162