~ubuntu-branches/ubuntu/maverick/bind9/maverick

« back to all changes in this revision

Viewing changes to lib/bind/irs/irp.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, LaMont Jones, Internet Software Consortium, Inc, localization folks
  • Date: 2008-08-02 14:20:20 UTC
  • mfrom: (1.2.1 upstream) (6.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080802142020-l1hon9jy8lbbjxmg
[LaMont Jones]

* default to using resolvconf if it is installed
* fix sonames and dependencies.  Closes: #149259, #492418
* Do not build-depend libcap2-dev on non-linux.  Closes: #493392
* drop unused query-loc manpage.  Closes: #492564
* lwresd: Deliver /etc/bind directory.  Closes: #490027
* fix query-source comment in default install

[Internet Software Consortium, Inc]

* 9.5.0-P2.  Closes: #492949

[localization folks]

* l10n: Spanish debconf translation.  Closes: #492425 (Ignacio Mondino)
* l10n: Swedish debconf templates.  Closes: #491369 (Martin Ågren)
* l10n: Japanese debconf translations.  Closes: #492048 (Hideki Yamane
  (Debian-JP))
* l10n: Finnish translation.  Closes: #490630 (Esko Arajärvi)
* l10n: Italian debconf translations.  Closes: #492587 (Alessandro Vietta)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
 
18
18
#if !defined(LINT) && !defined(CODECENTER)
19
 
static const char rcsid[] = "$Id: irp.c,v 1.3.2.1.10.2 2004/03/17 01:49:41 marka Exp $";
 
19
static const char rcsid[] = "$Id: irp.c,v 1.9.394.2 2008/02/28 05:46:12 marka Exp $";
20
20
#endif
21
21
 
22
22
/* Imports */
66
66
/* send errors to syslog if true. */
67
67
int irp_log_errors = 1;
68
68
 
69
 
/*
 
69
/*%
70
70
 * This module handles the irp module connection to irpd.
71
71
 *
72
72
 * The client expects a synchronous interface to functions like
74
74
 * the wire (it's used in the server).
75
75
 */
76
76
 
77
 
/*
 
77
/*%
78
78
 * irs_acc *irs_irp_acc(const char *options);
79
79
 *
80
80
 *      Initialize the irp module.
137
137
        return (0);
138
138
}
139
139
 
140
 
 
141
 
/*
 
140
/*%
142
141
 * int irs_irp_connect(void);
143
142
 *
144
143
 *      Sets up the connection to the remote irpd server.
245
244
        return (0);
246
245
}
247
246
 
248
 
 
249
 
 
250
 
/*
 
247
/*%
251
248
 * int  irs_irp_is_connected(struct irp_p *pvt);
252
249
 *
253
250
 * Returns:
261
258
        return (pvt->fdCxn >= 0);
262
259
}
263
260
 
264
 
 
265
 
 
266
 
/*
 
261
/*%
267
262
 * void
268
263
 * irs_irp_disconnect(struct irp_p *pvt);
269
264
 *
355
350
        return (buffpos);
356
351
}
357
352
 
358
 
 
359
 
 
360
 
 
361
 
 
362
 
/*
 
353
/*%
363
354
 * int irp_read_response(struct irp_p *pvt);
364
355
 *
365
356
 * Returns:
399
390
        return (code);
400
391
}
401
392
 
402
 
 
403
 
 
404
 
/*
 
393
/*%
405
394
 * char *irp_read_body(struct irp_p *pvt, size_t *size);
406
395
 *
407
396
 *      Read in the body of a response. Terminated by a line with
425
414
        char *buffer = memget(len);
426
415
        int idx = 0;
427
416
 
 
417
        if (buffer == NULL)
 
418
                return (NULL);
 
419
 
428
420
        for (;;) {
429
421
                if (irs_irp_read_line(pvt, line, sizeof line) <= 0 ||
430
422
                    strchr(line, '\n') == NULL)
468
460
        return (NULL);
469
461
}
470
462
 
471
 
 
472
 
/*
 
463
/*%
473
464
 * int irs_irp_get_full_response(struct irp_p *pvt, int *code,
474
465
 *                      char **body, size_t *bodylen);
475
466
 *
512
503
        return (0);
513
504
}
514
505
 
515
 
 
516
 
/*
 
506
/*%
517
507
 * int irs_irp_send_command(struct irp_p *pvt, const char *fmt, ...);
518
508
 *
519
509
 *      Sends command to remote connected via the PVT
520
 
 *      struture. FMT and args after it are fprintf-like
 
510
 *      structure. FMT and args after it are fprintf-like
521
511
 *      arguments for formatting.
522
512
 *
523
513
 * Returns:
538
528
        }
539
529
 
540
530
        va_start(ap, fmt);
541
 
        todo = vsprintf(buffer, fmt, ap);
 
531
        (void) vsprintf(buffer, fmt, ap);
 
532
        todo = strlen(buffer);
542
533
        va_end(ap);
543
534
        if (todo > (int)sizeof(buffer) - 3) {
544
535
                syslog(LOG_CRIT, "memory overrun in irs_irp_send_command()");
569
560
 
570
561
/* Methods */
571
562
 
572
 
 
573
 
 
574
 
/*
 
563
/*%
575
564
 * void irp_close(struct irs_acc *this)
576
565
 *
577
566
 */
590
579
 
591
580
 
592
581
 
 
582
 
 
583
/*! \file */