~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to include/snmp_pdu.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2009-09-24 14:51:06 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090924145106-38jgrzmj0d73pha5
Tags: 3.1.0.13-1
* Upload to experimental

* New upstream release
  - Fixes Follow-X-Forwarded-For support (Closes: #523943)
  - Adds IPv6 support (Closes: #432351)

* debian/rules
  - Removed obsolete configuration options
  - Enable db and radius basic authentication modules

* debian/patches/01-cf.data.debian
  - Adapted to new upstream version

* debian/patches/02-makefile-defaults
  - Adapted to new upstream version

* debian/{squid.postinst,squid.rc,README.Debian,watch}
  - Updated references to squid 3.1

* debian/squid3.install
  - Install CSS file for error pages
  - Install manual pages for new authentication modules

* debian/squid3-common.install
  - Install documented version of configuration file in /usr/share/doc/squid3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef SQUID_SNMP_PDU_H
2
2
#define SQUID_SNMP_PDU_H
3
3
 
 
4
#include "config.h"
 
5
/* required for oid typedef */
 
6
#include "asn1.h"
 
7
 
 
8
#if HAVE_NETINET_IN_H
 
9
/* required for sockaddr_in definition */
 
10
#include <netinet/in.h>
 
11
#endif
 
12
 
4
13
/**********************************************************************
5
14
 *
6
15
 *           Copyright 1997 by Carnegie Mellon University
7
 
 * 
 
16
 *
8
17
 *                       All Rights Reserved
9
 
 * 
 
18
 *
10
19
 * Permission to use, copy, modify, and distribute this software and its
11
20
 * documentation for any purpose and without fee is hereby granted,
12
21
 * provided that the above copyright notice appear in all copies and that
14
23
 * supporting documentation, and that the name of CMU not be
15
24
 * used in advertising or publicity pertaining to distribution of the
16
25
 * software without specific, written prior permission.
17
 
 * 
 
26
 *
18
27
 * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
19
28
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
20
29
 * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
22
31
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
23
32
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
24
33
 * SOFTWARE.
25
 
 * 
 
34
 *
26
35
 * Author: Ryan Troll <ryan+@andrew.cmu.edu>
27
 
 * 
28
 
 * $Id: snmp_pdu.h,v 1.11 2003/01/23 00:36:48 robertc Exp $
29
 
 * 
 
36
 *
 
37
 * $Id$
 
38
 *
30
39
 **********************************************************************/
31
40
 
32
41
#ifdef __cplusplus
33
 
extern "C" {
 
42
extern "C"
 
43
{
34
44
#endif
35
45
 
36
 
typedef struct sockaddr_in ipaddr;
37
 
 
38
 
/* An SNMP PDU */
39
 
struct snmp_pdu {
40
 
    int command;                /* Type of this PDU */
41
 
    ipaddr address;             /* Address of peer */
42
 
 
43
 
    int reqid;                  /* Integer32: Request id */
44
 
    int errstat;                /* INTEGER:   Error status */
45
 
    int errindex;               /* INTEGER:   Error index */
46
 
 
47
 
    /* SNMPv2 Bulk Request */
48
 
    int non_repeaters;          /* INTEGER: */
49
 
    int max_repetitions;        /* INTEGER: */
50
 
 
51
 
    struct variable_list *variables;    /* Variable Bindings */
52
 
 
53
 
    /* Trap information */
54
 
    oid *enterprise;            /* System OID */
55
 
    int enterprise_length;
56
 
    ipaddr agent_addr;          /* address of object generating trap */
57
 
    int trap_type;              /* generic trap type */
58
 
    int specific_type;          /* specific type */
59
 
    u_int time;                 /* Uptime */
60
 
};
61
 
 
62
 
struct snmp_pdu *snmp_pdu_create(int);
63
 
struct snmp_pdu *snmp_pdu_clone(struct snmp_pdu *);
64
 
struct snmp_pdu *snmp_pdu_fix(struct snmp_pdu *, int);
65
 
struct snmp_pdu *snmp_fix_pdu(struct snmp_pdu *, int);
66
 
void snmp_free_pdu(struct snmp_pdu *);
67
 
void snmp_pdu_free(struct snmp_pdu *);
68
 
 
69
 
u_char *snmp_pdu_encode(u_char *, int *, struct snmp_pdu *);
70
 
u_char *snmp_pdu_decode(u_char *, int *, struct snmp_pdu *);
 
46
    typedef struct sockaddr_in ipaddr;
 
47
 
 
48
    /* An SNMP PDU */
 
49
    struct snmp_pdu {
 
50
        int command;            /* Type of this PDU */
 
51
        ipaddr address;         /* Address of peer */
 
52
 
 
53
        int reqid;                      /* Integer32: Request id */
 
54
        int errstat;            /* INTEGER:   Error status */
 
55
        int errindex;           /* INTEGER:   Error index */
 
56
 
 
57
        /* SNMPv2 Bulk Request */
 
58
        int non_repeaters;              /* INTEGER: */
 
59
        int max_repetitions;    /* INTEGER: */
 
60
 
 
61
        struct variable_list *variables;        /* Variable Bindings */
 
62
 
 
63
        /* Trap information */
 
64
        oid *enterprise;                /* System OID */
 
65
        int enterprise_length;
 
66
        ipaddr agent_addr;              /* address of object generating trap */
 
67
        int trap_type;          /* generic trap type */
 
68
        int specific_type;              /* specific type */
 
69
        u_int time;                     /* Uptime */
 
70
    };
 
71
 
 
72
    struct snmp_pdu *snmp_pdu_create(int);
 
73
    struct snmp_pdu *snmp_pdu_clone(struct snmp_pdu *);
 
74
    struct snmp_pdu *snmp_pdu_fix(struct snmp_pdu *, int);
 
75
    struct snmp_pdu *snmp_fix_pdu(struct snmp_pdu *, int);
 
76
    void snmp_free_pdu(struct snmp_pdu *);
 
77
    void snmp_pdu_free(struct snmp_pdu *);
 
78
 
 
79
    u_char *snmp_pdu_encode(u_char *, int *, struct snmp_pdu *);
 
80
    u_char *snmp_pdu_decode(u_char *, int *, struct snmp_pdu *);
71
81
 
72
82
    /* Add a NULL Variable to a PDU */
73
 
void snmp_add_null_var(struct snmp_pdu *, oid *, int);
 
83
    void snmp_add_null_var(struct snmp_pdu *, oid *, int);
74
84
 
75
 
/* RFC 1905: Protocol Operations for SNMPv2
76
 
 *
77
 
 * RFC 1157: A Simple Network Management Protocol (SNMP)
78
 
 *
79
 
 * PDU Types
80
 
 */
 
85
    /* RFC 1905: Protocol Operations for SNMPv2
 
86
     *
 
87
     * RFC 1157: A Simple Network Management Protocol (SNMP)
 
88
     *
 
89
     * PDU Types
 
90
     */
81
91
#define SNMP_PDU_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0)
82
92
#define SNMP_PDU_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1)
83
93
#define SNMP_PDU_RESPONSE   (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2)
97
107
#define SNMP_DEFAULT_ADDRESS        0
98
108
#define SNMP_DEFAULT_REQID          0
99
109
 
100
 
/* RFC 1907: Management Information Base for SNMPv2
101
 
 *
102
 
 * RFC 1157: A Simple Network Management Protocol (SNMP)
103
 
 *
104
 
 * Trap Types
105
 
 */
 
110
    /* RFC 1907: Management Information Base for SNMPv2
 
111
     *
 
112
     * RFC 1157: A Simple Network Management Protocol (SNMP)
 
113
     *
 
114
     * Trap Types
 
115
     */
106
116
#if UNUSED_CODE
107
117
#define SNMP_TRAP_COLDSTART             (0x0)
108
118
#define SNMP_TRAP_WARMSTART             (0x1)