Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: linux-ipsec: Latest snapshot and 2.0.35

From: Richard Guy Briggs <rgb(at)conscoop.ottawa.on.ca>
Date: Tue Jul 28 1998 - 21:16:26 EDT


-----BEGIN PGP SIGNED MESSAGE-----
> Henry Spencer enscribed thusly:

Right. That is why it is encapsulated with #ifdef CONFIG_IPSEC. If I wanted it for both, I would put #ifdef CONFIG_IPSEC_MODULE as well. I am not absolutely certain that it does not set CONFIG_IPSEC when it is set to a module, only because of continuing reports of problems. I am using those here without problems. This is why I wonder if you haven't properly cleaned your kernel. If the protocol.o file does not get remade when you reconfig the kernel, you will see this problem, therefore, it is important to do 'make dep clean zImage install modules modules_install' (oh, and don't forget to uncomment the 'INSTALL' option in the main kernel makefile) every time you change config.

> Structure entries have been added to the inet_protocols which

It compiles and works for my module case. It compiles and works for Hugh's static link case.

> This may be an oversimplification and there may yet be other

Funny, I'm doing it...I should probably download the snapshot (in fact I will, just before the next release) to test it under several different circumstances.

Could you confirm that your net/ipv4/protocol.c looks like the attached file? The original file was a little awkward and not scalable. It has been redone.

> > Henry Spencer
> Mike

Do you need help?X

        slainte mhath, RGB
- --

Richard Guy Briggs -- PGP key available                       Auto-Free Ottawa!
rgb at conscoop dot ottawa dot on dot ca              
http://www.flora.org/afo/http://www.achilles.net/~rgb/                   Ottawa-Rideau Bioregion, Canada
Please send all spam to root@127.0.0.1

"We left our footprints in the Earth
And punched a hole right through the sky" -- S.Hogarth/J.Helmer(Marillion)

  • net/ipv4/protocol.c ======================================== /*
    • INET An implementation of the TCP/IP protocol suite for the LINUX
    • operating system. INET is implemented using the BSD Socket
    • interface as the means of communication with the user level. *
    • INET protocol dispatch tables. *
    • Version: @(#)protocol.c 1.0.5 05/25/93 *
    • Authors: Ross Biro, <bir7@leland.Stanford.Edu>
    • Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> *
    • Fixes:
    • Alan Cox : Ahah! udp icmp errors don't work because
    • udp_err is never called!
    • Alan Cox : Added new fields for init and ready for
    • proper fragmentation (_NO_ 4K limits!)
    • Richard Colella : Hang on hash collision *
    • This program is free software; you can redistribute it and/or
    • modify it under the terms of the GNU General Public License
    • as published by the Free Software Foundation; either version
    • 2 of the License, or (at your option) any later version. */
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#ifdef CONFIG_IPSEC
#ifdef CONFIG_IPSEC_AH
# include <../net/ipsec/ipsec_ah.h>
#endif /* CONFIG_IPSEC_AH */
#ifdef CONFIG_IPSEC_ESP
# include <../net/ipsec/ipsec_esp.h>
#endif /* CONFIG_IPSEC_ESP */
#endif /* CONFIG_IPSEC */

#define NEXT_PROTO NULL

static struct inet_protocol icmp_protocol = {

        icmp_rcv,               /* ICMP handler         */
        NULL,                   /* ICMP error control   */
        NEXT_PROTO,             /* next                 */
#undef NEXT_PROTO
#define NEXT_PROTO &icmp_protocol
        IPPROTO_ICMP,           /* protocol ID          */
        0,                      /* copy                 */
        NULL,                   /* data                 */
        "ICMP"                  /* name                 */
};

#ifdef CONFIG_IP_MULTICAST
static struct inet_protocol igmp_protocol = {

        igmp_rcv,               /* IGMP handler         */
        NULL,                   /* IGMP error control   */
        NEXT_PROTO,             /* next                 */
#undef NEXT_PROTO
#define NEXT_PROTO &igmp_protocol
        IPPROTO_IGMP,           /* protocol ID          */
        0,                      /* copy                 */
        NULL,                   /* data                 */
        "IGMP"                  /* name                 */
};
#endif /* CONFIG_IP_MULTICAST */

#ifdef CONFIG_NET_IPIP
static struct inet_protocol ipip_protocol = {

        ipip_rcv,               /* IPIP handler          */
Do you need more help?X
NULL, /* TUNNEL error control */ NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &ipip_protocol
        IPPROTO_IPIP,           /* protocol ID          */
        0,                      /* copy                 */
        NULL,                   /* data                 */
        "IPIP"                  /* name                 */
};
#endif /* CONFIG_NET_IPIP */

static struct inet_protocol tcp_protocol = {

        tcp_rcv,                /* TCP handler          */
        tcp_err,                /* TCP error control    */
        NEXT_PROTO,             /* next                 */
#undef NEXT_PROTO
#define NEXT_PROTO &tcp_protocol
        IPPROTO_TCP,            /* protocol ID          */
        0,                      /* copy                 */
        NULL,                   /* data                 */
        "TCP"                   /* name                 */
};

static struct inet_protocol udp_protocol = {

        udp_rcv,                /* UDP handler          */
        udp_err,                /* UDP error control    */
        NEXT_PROTO,             /* next                 */
#undef NEXT_PROTO
#define NEXT_PROTO &udp_protocol
        IPPROTO_UDP,            /* protocol ID          */
        0,                      /* copy                 */
        NULL,                   /* data                 */
        "UDP"                   /* name                 */
};
Can we help you?X

#ifdef CONFIG_IPSEC
#ifdef CONFIG_IPSEC_ESP
struct inet_protocol esp_protocol = {

        esp_rcv,                /* ESP handler          */
#if 0
        NULL,                   /* Will be UDP fraglist handler */
#endif
        NULL,                   /* TUNNEL error control */
        NEXT_PROTO,             /* next                 */
#undef NEXT_PROTO
#define NEXT_PROTO &esp_protocol
        IPPROTO_ESP,            /* protocol ID */
        0,                      /* copy */
        NULL,                   /* data */
        "ESP"                   /* name */
};
#endif /* CONFIG_IPSEC_ESP */

#ifdef CONFIG_IPSEC_AH
struct inet_protocol ah_protocol = {

        ah_rcv,                 /* AH handler */
#if 0
        NULL,                   /* Will be UDP fraglist handler */
#endif
Can't find what you're looking for?X
NULL, /* TUNNEL error control */ NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &ah_protocol
        IPPROTO_AH,             /* protocol ID */
        0,                      /* copy */
        NULL,                   /* data */
        "AH"                    /* name */
};
#endif /* CONFIG_IPSEC_AH */
#endif /* CONFIG_IPSEC */

struct inet_protocol *inet_protocol_base = NEXT_PROTO;

struct inet_protocol *inet_protos[MAX_INET_PROTOS] = {

        NULL
};

/*
 *      Find a protocol in the protocol tables given its
 *      IP type.
 */

struct inet_protocol *inet_get_protocol(unsigned char prot) {

        unsigned char hash;
        struct inet_protocol *p;

        hash = prot & (MAX_INET_PROTOS - 1);
        for (p = inet_protos[hash] ; p != NULL; p=p->next)
        {
                if (p->protocol == prot)
                        return((struct inet_protocol *) p);
        }
        return(NULL);

}
/*
 *      Add a protocol handler to the hash tables
 */

void inet_add_protocol(struct inet_protocol *prot) {

        unsigned char hash;
        struct inet_protocol *p2;

        hash = prot->protocol & (MAX_INET_PROTOS - 1);
        prot ->next = inet_protos[hash];
        inet_protos[hash] = prot;
        prot->copy = 0;

        /*
         *      Set the copy bit if we need to.
         */

        p2 = (struct inet_protocol *) prot->next;
        while(p2 != NULL)
        {
                if (p2->protocol == prot->protocol)
                {
                        prot->copy = 1;
                        break;
                }
                p2 = (struct inet_protocol *) p2->next;
        }

}
/*
 *      Remove a protocol from the hash tables.
 */

int inet_del_protocol(struct inet_protocol *prot) {

        struct inet_protocol *p;
        struct inet_protocol *lp = NULL;
        unsigned char hash;

        hash = prot->protocol & (MAX_INET_PROTOS - 1);
        if (prot == inet_protos[hash])
        {
                inet_protos[hash] = (struct inet_protocol *) inet_protos[hash]->next;
                return(0);
        }

        p = (struct inet_protocol *) inet_protos[hash];
        while(p != NULL)
Confused? Frustrated?X
{ /* * We have to worry if the protocol being deleted is * the last one on the list, then we may need to reset * someone's copied bit. */ if (p->next != NULL && p->next == prot) { /* * if we are the last one with this protocol and * there is a previous one, reset its copy bit. */ if (p->copy == 0 && lp != NULL) lp->copy = 0; p->next = prot->next; return(0); } if (p->next != NULL && p->next->protocol == prot->protocol) lp = p; p = (struct inet_protocol *) p->next; } return(-1);

}
Don't know where to look next?X

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBNb536N+sBuIhFagtAQEO4gP/d+2cVupNtCBBHXSOOAZ/Faxo/rcavYlg g3mEcJxMRV2sN/8DVNLzwSOLU+hR/xQjOSQaHivFU97g72TlX9b1rlDO/0IAnN7L aOLIiJ8vq5ehtW9qiDL1jUM6A5k6u42mHFwg+t4VqwyxH6RO8sbAuPLf367WZbuN suguNPwV3IU=
=eF1g
-----END PGP SIGNATURE----- Received on Tue Jul 28 21:17:16 1998

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 12:59:25 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library