Skip to content

Commit

Permalink
[NETFILTER]: nf_conntrack_h323: fix ASN.1 types
Browse files Browse the repository at this point in the history
1. Add support for decoding IPv6 address. I know it was manually added in
   the header file, but not in the template file. That wouldn't work.
2. Add missing support for decoding T.120 address in OLCA.
3. Remove unnecessary decoding of Information signal.

Signed-off-by: Jing Min Zhao <zhaojingmin@vivecode.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jing Min Zhao authored and David S. Miller committed May 24, 2007
1 parent 25b86e0 commit d052918
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 38 deletions.
23 changes: 3 additions & 20 deletions include/linux/netfilter/nf_conntrack_h323_types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by Jing Min Zhao's ASN.1 parser, Apr 20 2006
/* Generated by Jing Min Zhao's ASN.1 parser, May 16 2007
*
* Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
*
Expand All @@ -12,7 +12,7 @@ typedef struct TransportAddress_ipAddress { /* SEQUENCE */

typedef struct TransportAddress_ip6Address { /* SEQUENCE */
int options; /* No use */
unsigned ip6;
unsigned ip;
} TransportAddress_ip6Address;

typedef struct TransportAddress { /* CHOICE */
Expand Down Expand Up @@ -364,23 +364,6 @@ typedef struct Alerting_UUIE { /* SEQUENCE */
Alerting_UUIE_fastStart fastStart;
} Alerting_UUIE;

typedef struct Information_UUIE_fastStart { /* SEQUENCE OF */
int count;
OpenLogicalChannel item[30];
} Information_UUIE_fastStart;

typedef struct Information_UUIE { /* SEQUENCE */
enum {
eInformation_UUIE_callIdentifier = (1 << 31),
eInformation_UUIE_tokens = (1 << 30),
eInformation_UUIE_cryptoTokens = (1 << 29),
eInformation_UUIE_fastStart = (1 << 28),
eInformation_UUIE_fastConnectRefused = (1 << 27),
eInformation_UUIE_circuitInfo = (1 << 26),
} options;
Information_UUIE_fastStart fastStart;
} Information_UUIE;

typedef struct FacilityReason { /* CHOICE */
enum {
eFacilityReason_routeCallToGatekeeper,
Expand Down Expand Up @@ -471,7 +454,6 @@ typedef struct H323_UU_PDU_h323_message_body { /* CHOICE */
CallProceeding_UUIE callProceeding;
Connect_UUIE connect;
Alerting_UUIE alerting;
Information_UUIE information;
Facility_UUIE facility;
Progress_UUIE progress;
};
Expand Down Expand Up @@ -561,6 +543,7 @@ typedef struct OpenLogicalChannelAck { /* SEQUENCE */
} options;
OpenLogicalChannelAck_reverseLogicalChannelParameters
reverseLogicalChannelParameters;
NetworkAccessParameters separateStack;
OpenLogicalChannelAck_forwardMultiplexAckParameters
forwardMultiplexAckParameters;
} OpenLogicalChannelAck;
Expand Down
31 changes: 13 additions & 18 deletions net/netfilter/nf_conntrack_h323_types.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by Jing Min Zhao's ASN.1 parser, Apr 20 2006
/* Generated by Jing Min Zhao's ASN.1 parser, May 16 2007
*
* Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
*
Expand Down Expand Up @@ -37,7 +37,7 @@ static field_t _TransportAddress_ipxAddress[] = { /* SEQUENCE */

static field_t _TransportAddress_ip6Address[] = { /* SEQUENCE */
{FNAME("ip") OCTSTR, FIXD, 16, 0, DECODE,
offsetof(TransportAddress_ip6Address, ip6), NULL},
offsetof(TransportAddress_ip6Address, ip), NULL},
{FNAME("port") INT, WORD, 0, 0, SKIP, 0, NULL},
};

Expand Down Expand Up @@ -67,7 +67,8 @@ static field_t _TransportAddress[] = { /* CHOICE */
{FNAME("ipxAddress") SEQ, 0, 3, 3, SKIP, 0,
_TransportAddress_ipxAddress},
{FNAME("ip6Address") SEQ, 0, 2, 2, DECODE | EXT,
offsetof(TransportAddress, ip6Address), _TransportAddress_ip6Address},
offsetof(TransportAddress, ip6Address),
_TransportAddress_ip6Address},
{FNAME("netBios") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL},
{FNAME("nsap") OCTSTR, 5, 1, 0, SKIP, 0, NULL},
{FNAME("nonStandardAddress") SEQ, 0, 2, 2, SKIP, 0,
Expand Down Expand Up @@ -638,7 +639,8 @@ static field_t _UnicastAddress_iPXAddress[] = { /* SEQUENCE */
};

static field_t _UnicastAddress_iP6Address[] = { /* SEQUENCE */
{FNAME("network") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL},
{FNAME("network") OCTSTR, FIXD, 16, 0, DECODE,
offsetof(UnicastAddress_iP6Address, network), NULL},
{FNAME("tsapIdentifier") INT, WORD, 0, 0, SKIP, 0, NULL},
};

Expand All @@ -665,8 +667,8 @@ static field_t _UnicastAddress[] = { /* CHOICE */
offsetof(UnicastAddress, iPAddress), _UnicastAddress_iPAddress},
{FNAME("iPXAddress") SEQ, 0, 3, 3, SKIP | EXT, 0,
_UnicastAddress_iPXAddress},
{FNAME("iP6Address") SEQ, 0, 2, 2, SKIP | EXT, 0,
_UnicastAddress_iP6Address},
{FNAME("iP6Address") SEQ, 0, 2, 2, DECODE | EXT,
offsetof(UnicastAddress, iP6Address), _UnicastAddress_iP6Address},
{FNAME("netBios") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL},
{FNAME("iPSourceRouteAddress") SEQ, 0, 4, 4, SKIP | EXT, 0,
_UnicastAddress_iPSourceRouteAddress},
Expand Down Expand Up @@ -984,19 +986,12 @@ static field_t _Alerting_UUIE[] = { /* SEQUENCE */
{FNAME("featureSet") SEQ, 3, 4, 4, SKIP | EXT | OPT, 0, NULL},
};

static field_t _Information_UUIE_fastStart[] = { /* SEQUENCE OF */
{FNAME("item") SEQ, 1, 3, 5, DECODE | OPEN | EXT,
sizeof(OpenLogicalChannel), _OpenLogicalChannel}
,
};

static field_t _Information_UUIE[] = { /* SEQUENCE */
{FNAME("protocolIdentifier") OID, BYTE, 0, 0, SKIP, 0, NULL},
{FNAME("callIdentifier") SEQ, 0, 1, 1, SKIP | EXT, 0, NULL},
{FNAME("tokens") SEQOF, SEMI, 0, 0, SKIP | OPT, 0, NULL},
{FNAME("cryptoTokens") SEQOF, SEMI, 0, 0, SKIP | OPT, 0, NULL},
{FNAME("fastStart") SEQOF, SEMI, 0, 30, DECODE | OPT,
offsetof(Information_UUIE, fastStart), _Information_UUIE_fastStart},
{FNAME("fastStart") SEQOF, SEMI, 0, 30, SKIP | OPT, 0, NULL},
{FNAME("fastConnectRefused") NUL, FIXD, 0, 0, SKIP | OPT, 0, NULL},
{FNAME("circuitInfo") SEQ, 3, 3, 3, SKIP | EXT | OPT, 0, NULL},
};
Expand Down Expand Up @@ -1343,9 +1338,7 @@ static field_t _H323_UU_PDU_h323_message_body[] = { /* CHOICE */
offsetof(H323_UU_PDU_h323_message_body, connect), _Connect_UUIE},
{FNAME("alerting") SEQ, 1, 3, 17, DECODE | EXT,
offsetof(H323_UU_PDU_h323_message_body, alerting), _Alerting_UUIE},
{FNAME("information") SEQ, 0, 1, 7, DECODE | EXT,
offsetof(H323_UU_PDU_h323_message_body, information),
_Information_UUIE},
{FNAME("information") SEQ, 0, 1, 7, SKIP | EXT, 0, _Information_UUIE},
{FNAME("releaseComplete") SEQ, 1, 2, 11, SKIP | EXT, 0,
_ReleaseComplete_UUIE},
{FNAME("facility") SEQ, 3, 5, 21, DECODE | EXT,
Expand Down Expand Up @@ -1430,7 +1423,9 @@ static field_t _OpenLogicalChannelAck[] = { /* SEQUENCE */
DECODE | EXT | OPT, offsetof(OpenLogicalChannelAck,
reverseLogicalChannelParameters),
_OpenLogicalChannelAck_reverseLogicalChannelParameters},
{FNAME("separateStack") SEQ, 2, 4, 5, SKIP | EXT | OPT, 0, NULL},
{FNAME("separateStack") SEQ, 2, 4, 5, DECODE | EXT | OPT,
offsetof(OpenLogicalChannelAck, separateStack),
_NetworkAccessParameters},
{FNAME("forwardMultiplexAckParameters") CHOICE, 0, 1, 1,
DECODE | EXT | OPT, offsetof(OpenLogicalChannelAck,
forwardMultiplexAckParameters),
Expand Down

0 comments on commit d052918

Please sign in to comment.