~ubuntu-branches/debian/sid/ion/sid

« back to all changes in this revision

Viewing changes to bp/dccp/dccpcli.c

  • Committer: Package Import Robot
  • Author(s): Leo Iannacone
  • Date: 2014-10-14 16:40:07 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20141014164007-67bp5oth2mfjuqs8
Tags: 3.2.1+dfsg-1
* New upstream release.
* Bump Standards-Version 3.9.6
* debian/copyright:
  - update Upstream-Name
  - update Format
  - add Upstream-Contact
  - add comment to repacking and Files-Excluded field
  - add short license name for upstream license
* Remove repack.* utilities in favor of Files-Excluted
* debian/rules:remove call to REPACK_SH
* debian/watch: update dsfg dversionmangle
* debian/patches:
  - remove fix-manpages-errors.patch: applied upstream
  - refresh patches and renamed adding a number suffix
  - 0002-fix-dtnperf-undefined-symbols.patch:
    add LIBADD to libal_pb_vION, prevents undefined-symbols
  - 0003-ftbfs-with-clang.patch:
    fix FTBFS if clang is used instead of gcc (closes: #754319)
* Update debian/links to binaries without manpage

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
typedef struct
44
44
{
45
 
        int                                     sock;
46
 
        pthread_t                       mainThread;
47
 
        pthread_t                       me;
48
 
        int                                     running;
 
45
        int                     sock;
 
46
        pthread_t               mainThread;
 
47
        pthread_t               me;
 
48
        int                     running;
49
49
        struct sockaddr_in      fromAddr;
50
 
        VInduct                         *vduct;
 
50
        VInduct                 *vduct;
51
51
        pthread_mutex_t         *elk;
52
 
        Lyst                            *list;
 
52
        Lyst                    *list;
53
53
} ReceiverThreadParms;
54
54
 
55
55
ReceiverThreadParms* create_new_thread_data(Lyst *list)
142
142
        /*      Main loop for bundle reception thread on one
143
143
         *      connection, terminating when connection is lost.        */
144
144
        ReceiverThreadParms     *rtp = (ReceiverThreadParms*)param;
145
 
        unsigned int                    hostNbr;
146
 
        char                                    hostName[MAXHOSTNAMELEN + 1];
147
 
        char                                    senderEidBuffer[SDRSTRING_BUFSZ];
148
 
        char                                    *senderEid;
149
 
        char                                    *buffer;
150
 
        AcqWorkArea                             *work;
151
 
        int                                     bundleLength;
 
145
        char                    *buffer;
 
146
        AcqWorkArea             *work;
 
147
        int                     bundleLength;
152
148
        
153
149
        iblock(SIGTERM);
154
150
        isignal(SIGUSR1, siguser_thread);
156
152
        isignal(SIGPIPE, handleConnectionLoss);
157
153
#endif
158
154
 
159
 
        /* Determine what the sender's EID is given it's IP             */
160
 
        memcpy((char *) &hostNbr, (char *) &(rtp->fromAddr.sin_addr.s_addr), 4);
161
 
        hostNbr = ntohl(hostNbr);
162
 
        if (getInternetHostName(hostNbr, hostName))
163
 
        {
164
 
                senderEid = senderEidBuffer;
165
 
                getSenderEid(&senderEid, hostName);
166
 
        }
167
 
        else
168
 
        {
169
 
                senderEid = NULL;
170
 
        }
171
 
 
172
155
        /* Get buffers                                                  */
173
156
        writeErrmsgMemos();
174
157
        work = bpGetAcqArea(rtp->vduct);
225
208
                }
226
209
 
227
210
                pthread_mutex_lock(rtp->elk);
228
 
                if (bpBeginAcq(work, 0, senderEid) < 0 
 
211
                if (bpBeginAcq(work, 0, NULL) < 0 
229
212
                                || bpContinueAcq(work, buffer, bundleLength) < 0
230
213
                                || bpEndAcq(work) < 0)
231
214
                {
249
232
        writeErrmsgMemos();
250
233
        MRELEASE(buffer);
251
234
        bpReleaseAcqArea(work);
252
 
return NULL;
 
235
        return NULL;
253
236
}
254
237
 
255
238
/*      *       *       Listener thread functions       *       *       */
256
239
typedef struct
257
240
{
258
 
        int                     linkSocket;
 
241
        int             linkSocket;
259
242
        VInduct         *vduct;
260
243
        pthread_t       mainThread;
261
 
        int                     running;
 
244
        int             running;
262
245
} ListenerThreadParms;
263
246
 
264
247
 
265
248
static void     *Listen_for_connections(void *parm)
266
249
{
267
250
        /*      Main loop for DCCP connection handling                  */
268
 
        ListenerThreadParms             *rtp = (ListenerThreadParms *) parm;
269
 
        Lyst                                    list;
270
 
        pthread_mutex_t                 elk;
271
 
        struct sockaddr                 fromAddr;
272
 
        int                                             consock;
273
 
        socklen_t                               solen;
274
 
        ReceiverThreadParms             *rp;
 
251
        ListenerThreadParms     *rtp = (ListenerThreadParms *) parm;
 
252
        Lyst                    list;
 
253
        pthread_mutex_t         elk;
 
254
        struct sockaddr         fromAddr;
 
255
        int                     consock;
 
256
        socklen_t               solen;
 
257
        ReceiverThreadParms     *rp;
275
258
 
276
259
        list = lyst_create_using(getIonMemoryMgr());
277
260
        lyst_clear(list);
369
352
{
370
353
        char    *ductName = (argc > 1 ? argv[1] : NULL);
371
354
#endif
372
 
        Sdr                                     sdr;
373
 
        VInduct                         *vduct;
374
 
        PsmAddress                      vductElt;
375
 
        Induct                          duct;
376
 
        ClProtocol                      protocol;
377
 
        char                            *hostName;
 
355
        Sdr                     sdr;
 
356
        VInduct                 *vduct;
 
357
        PsmAddress              vductElt;
 
358
        Induct                  duct;
 
359
        ClProtocol              protocol;
 
360
        char                    *hostName;
378
361
        unsigned short          portNbr = 0;
379
362
        unsigned int            ipAddress = 0;
380
363
        struct sockaddr         socketName;
381
364
        struct sockaddr_in      *inetName;
382
365
        ListenerThreadParms     rtp;
383
 
        pthread_t                       listenerThread;
384
 
 
385
 
 
 
366
        pthread_t               listenerThread;
386
367
 
387
368
        if (ductName == NULL)
388
369
        {
454
435
                return 1;
455
436
        }
456
437
 
457
 
        /*      Initialize sender endpoint ID lookup.                   */
458
 
        ipnInit();
459
 
        dtn2Init();
460
 
 
461
438
        /*      Set up signal handling; SIGTERM is shutdown signal.     */
462
439
        isignal(SIGTERM, interruptThread);
463
440
#ifndef mingw
494
471
 
495
472
#else /*build_dccp*/
496
473
 
497
 
 
498
474
#include "bpP.h"
499
475
#if defined (VXWORKS) || defined (RTEMS)
500
476
int     dccpcli(int a1, int a2, int a3, int a4, int a5,
509
485
return 0;
510
486
}
511
487
 
512
 
 
513
488
#endif /*build_dccp*/