Skip to contentSkip to conversation

time match module make error

DISCUSSION chang 2 participants 3 messages Dec 7, 2005 netfilter

lore
Share & tools
lore

chang

author
#0 lore raw

hi,all,I download patch-o-matic-ng-20051205.tar.bz2 and iptables-1.3.4.tar.bz2 from ftp.netfilter.org,and linux-2.6.13.4.tar.bz2 from www.kernel.org.but there is some error when i compile them:

-------error messages------------

CC net/ipv4/netfilter/ipt_time.o
net/ipv4/netfilter/ipt_time.c: In function `match':
net/ipv4/netfilter/ipt_time.c:59: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:60: warning: implicit declaration of function __net_timestamp' net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:67: error: structure has no member named `tstamp' make[3]: *** [net/ipv4/netfilter/ipt_time.o] Error 1
make[2]: *** [net/ipv4/netfilter] Error 2
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2
---------------------cut here--------------------

so i read the file "ipt_time.c" and find the error is maybe at "skb->tstamp"

-------ipt_time.c------------------
static int
match(const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
const void *matchinfo,
int offset,
int *hotdrop)

{
        const struct ipt_time_info *info = matchinfo;   /* match info for rule */
        struct tm currenttime;                          /* time human readable */
        u_int8_t days_of_week[7] = {64, 32, 16, 8, 4, 2, 1};
        u_int16_t packet_time;

        /* We might not have a timestamp, get one */
        if (skb->tstamp.off_sec == 0)
                __net_timestamp((struct sk_buff *)skb);

        /* First we make sure we are in the date start-stop boundaries */
        if ((skb->tstamp.off_sec < info->date_start) || (skb->tstamp.off_sec > info->date_stop))
                return 0; /* We are outside the date boundaries */

        /* Transform the timestamp of the packet, in a human readable form */
        localtime(skb->tstamp.off_sec, &currenttime);

        /* check if we match this timestamp, we start by the days... */
        if ((days_of_week[currenttime.tm_wday] & info->days_match) != days_of_week[currenttime.tm_wday])
                return 0; /* the day doesn't match */

        /* ... check the time now */
        packet_time = (currenttime.tm_hour * 60) + currenttime.tm_min;
        if ((packet_time < info->time_start) || (packet_time > info->time_stop))
                return 0;

        /* here we match ! */
        return 1;
}

---------------------cut here--------------------

then i read the file "include/linux/skbuff.h",i find there is no the member "tstamp" in the struct "sk_buff"

--------------------skbuff.h----------------------

struct sk_buff {
        /* These two members must be first. */
        struct sk_buff          *next;
        struct sk_buff          *prev;

        struct sk_buff_head     *list;
        struct sock             *sk;
        struct timeval          stamp;
        struct net_device       *dev;
        struct net_device       *input_dev;
        struct net_device       *real_dev;

        union {
                struct tcphdr   *th;
                struct udphdr   *uh;
                struct icmphdr  *icmph;
                struct igmphdr  *igmph;
                struct iphdr    *ipiph;
                struct ipv6hdr  *ipv6h;
                unsigned char   *raw;
        } h;

        union {
                struct iphdr    *iph;
                struct ipv6hdr  *ipv6h;
                struct arphdr   *arph;
                unsigned char   *raw;
        } nh;

        union {
                unsigned char   *raw;
        } mac;

        struct  dst_entry       *dst;
        struct  sec_path        *sp;

        /*
         * This is the control buffer. It is free to use for every
         * layer. Please put your private variables there. If you
         * want to keep them across layers you have to do a skb_clone()
         * first. This is owned by whoever has the skb queued ATM.
         */
        char                    cb[40];

        unsigned int            len,
                                data_len,
                                mac_len,
                                csum;
        __u32                   priority;
        __u8                    local_df:1,
                                cloned:1,
                                ip_summed:2,
                                nohdr:1;
                                /* 3 bits spare */
        __u8                    pkt_type;
        __be16                  protocol;

        void                    (*destructor)(struct sk_buff *skb);
#ifdef CONFIG_NETFILTER
        unsigned long           nfmark;
        __u32                   nfcache;
        __u32                   nfctinfo;
        struct nf_conntrack     *nfct;
#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
        unsigned char           imq_flags;
        struct nf_info          *nf_info;

#endif

#ifdef CONFIG_BRIDGE_NETFILTER
        struct nf_bridge_info   *nf_bridge;
#endif
#endif /* CONFIG_NETFILTER */
#if defined(CONFIG_HIPPI)
        union {
                __u32           ifield;
        } private;

#endif
#ifdef CONFIG_NET_SCHED
__u32 tc_index; /* traffic control index */
#ifdef CONFIG_NET_CLS_ACT

        __u32           tc_verd;               /* traffic control verdict */
        __u32           tc_classid;            /* traffic control classid */

#endif

#endif

        /* These elements must be at the end, see alloc_skb() for details.  */
        unsigned int            truesize;
        atomic_t                users;
        unsigned char           *head,
                                *data,
                                *tail,
                                *end;
};

---------------------cut here--------------------

what should i do,who can help me.thanks.

#1 lore raw
Quoted 19 lines · chang

hi,all,I download patch-o-matic-ng-20051205.tar.bz2 and iptables-1.3.4.tar.bz2 from ftp.netfilter.org,and linux-2.6.13.4.tar.bz2 from www.kernel.org.but there is some error when i compile them:

-------error messages------------

CC net/ipv4/netfilter/ipt_time.o
net/ipv4/netfilter/ipt_time.c: In function `match':
net/ipv4/netfilter/ipt_time.c:59: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:60: warning: implicit declaration of function __net_timestamp' net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:67: error: structure has no member named `tstamp' make[3]: *** [net/ipv4/netfilter/ipt_time.o] Error 1
make[2]: *** [net/ipv4/netfilter] Error 2
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2
---------------------cut here--------------------

so i read the file "ipt_time.c" and find the error is maybe at "skb->tstamp" -------ipt_time.c------------------

<CUT>

Quoted 5 lines

---------------------cut here--------------------

then i read the file "include/linux/skbuff.h",i find there is no the member "tstamp" in the struct "sk_buff"

--------------------skbuff.h----------------------

<CUT>

Quoted 3 lines

---------------------cut here--------------------

what should i do,who can help me.thanks.

You simply need more recent kernel (2.6.14.x) or older patch-o-matic-ng.

Best regards,

Krzysztof Olędzki

author
#2 lore raw

Thank you for your help,I have already download the linux-2.6.14.3.tar.bz2,there is the member "tstamp" in the struct "sk_buff", I think it will be compiled successfully. The update of "time match module" is so quick, thanks the author.

Best regards

----- Original Message -----
From: "Krzysztof Oledzki" <[email protected]>
To: "chang" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, December 07, 2005 5:33 PM
Subject: Re: time match module make error

Quoted 21 lines · chang

hi,all,I download patch-o-matic-ng-20051205.tar.bz2 and iptables-1.3.4.tar.bz2 from ftp.netfilter.org,and linux-2.6.13.4.tar.bz2 from www.kernel.org.but there is some error when i compile them:

-------error messages------------

CC net/ipv4/netfilter/ipt_time.o
net/ipv4/netfilter/ipt_time.c: In function `match':
net/ipv4/netfilter/ipt_time.c:59: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:60: warning: implicit declaration of function __net_timestamp' net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named tstamp' net/ipv4/netfilter/ipt_time.c:67: error: structure has no member named `tstamp' make[3]: *** [net/ipv4/netfilter/ipt_time.o] Error 1
make[2]: *** [net/ipv4/netfilter] Error 2
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2
---------------------cut here--------------------

so i read the file "ipt_time.c" and find the error is maybe at "skb->tstamp" -------ipt_time.c------------------

<CUT>

Quoted 5 lines

---------------------cut here--------------------

then i read the file "include/linux/skbuff.h",i find there is no the member "tstamp" in the struct "sk_buff"

--------------------skbuff.h----------------------

<CUT>

Quoted 3 lines

---------------------cut here--------------------

what should i do,who can help me.thanks.

You simply need more recent kernel (2.6.14.x) or older patch-o-matic-ng.

Best regards,

Krzysztof Olędzki