Linux-Development-Sys Digest #718, Volume #7 Thu, 30 Mar 00 10:13:18 EST
Contents:
skb pointer problem (Andreas Rennen)
Re: Upgrading to 2.2.14. Help? (Warren Young)
Re: Free BSD (Warren Young)
Re: skb pointer problem ("Jerome Tollet")
Re: skb pointer problem (Andi Kleen)
linker problems ("Stewart Coomb")
insmod external names resolving problem ("Gennadiy M. Kurtsman")
Documentation on /dev/raw ("Someone Insignificant")
Compile IMG ("onno janony")
Re: software raid patch (=?iso-8859-1?Q?Rasmus_B=F8g_Hansen?=)
Re: skb pointer problem ("Jerome Tollet")
Re: Linux and Posix AIO (Fabrice Peix)
2.3.99pre3 - still won't compile (bill davidsen)
Re: 2.3.99: what's next step? (bill davidsen)
Re: latest 2.3.99-pre3 won't boot on I-OPENER (bill davidsen)
Re: Stupid Question (Chad Wolfsheimer)
Re: 2.3.99: what's next step? (Aki M Laukkanen)
----------------------------------------------------------------------------
From: Andreas Rennen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking,comp.unix.programmer
Subject: skb pointer problem
Date: Thu, 30 Mar 2000 11:27:24 +0200
Hi to All,
I have the following problem:
Inside of my new device-driver i have to find the protocol of a
packet and the portnumber to do different things.
In logic it looks like :
If Customer X (IP=x) and the protocol is no 6 (TCP) and port is no 20
(FTP-Data) then do the following...
A packet "belongs" to a socket ( here sk ). In sk is a list of pointers
with
a buffer for each packet. Those have the structure sk_buff ( here skb )
In the include-Files the structures look like:
The structure of the packetbuffers is in /linux/sk_buff.h
struct sk_buff{
struct sk_buff *next;
struct sk_buff *prev;
struct sk_buff_head *list;
struct sock *sk;
...
union
{
struct tcphdr *th; /* The wanted TCP-Header */
struct udphdr *uh;
struct icmphdr *icmph;
...
unsigned char *raw;
} h;
union
{
struct iphdr *iph; /* The used IP-Header */
struct ipv6hdr *ipv6h;
...
unsigned char *raw;
} nh;
...
};
The strukture of the IP-Header is in /linux/ip.h
struct iphdr {
...
__u8 tos;
__u16 tot_len;
...
__u32 saddr; /* The user source-ip */
__u32 daddr;
}
The strukture of the TCP-Header is in /linux/tcp.h
struct tcphdr {
__u16 source; /* Wanted Source-Port */
__u16 dest; /* Wanted Destination-Port */
__u32 seq;
...
}
I developed the following lines of code for my device an they work well:
/* Find Customer IP - asuming that protocol is 6*/
if( ((struct iphdr *)(skb->nh.iph))->saddr==customerip )
{
/* Find port number */
if((ntohs(((unsigned int)((struct tcphdr
*)(skb->h.th)+1)->source))==20)
/* ntohs = net to hostbyteorder smal */
...
What i can understand is that skb points to nh.iph and this points to
saddr.
In the same way i can test for the protocol. In this case the structure
iph
is member of the union nh.
The short form looks like this : skb->nh.iph->saddr
Ok with that - but now i want to reach the value for the sourceport over
the union h by using the member th and then pointing to source
.
I wrote in my programmierte skb->h.th->source. And that does not work!
It works only with h.th+1
I have seen this kind of manipulation in other sources and even i do not
understand this i tryed it. Know what ? - It works fine.
The next sample works perfect:
if((ntohs(((unsigned int)((struct tcphdr *)(skb->h.th)+1)->source))==20)
/* FTP-Data = 20*/
W h y i n h e l l i s t h a t + 1 ?
Thank you for any help on this.
Regards
Andreas Rennen
------------------------------
Date: Thu, 30 Mar 2000 02:03:51 -0700
From: Warren Young <[EMAIL PROTECTED]>
Subject: Re: Upgrading to 2.2.14. Help?
[EMAIL PROTECTED] wrote:
>
> 1) Where can I get a copy of binutils that will install correctly, and will
> the failed install screw things up?
Building gcc and all the associated stuff isn't really something I
recommend you do unless that's the only way you can get the packages you
need. It's difficult to get right, it's time consuming, and the
packages are too complex for most users to customize, so you'll be
building with the default options anyway -- what's the point of building
from source?
I see below that you mention Slackware -- I point you at RPMs below,
which you can either install as-is or convert `em to tarballs with alien
if you really dislike RPMs.
I just updated my own build system an hour ago. On the Red Hat Rawhide
site, you can get RPMs of the latest binutils, gcc, g++, cpp, glibc,
glibc-devel, libstdc++ and libstdc++-devel. You'll need all of those
packages, plus perhaps libstdc++-compat. (Assuming you want both C and
C++.) I personally used ftp.cs.columbia.edu's mirror. Make sure you
get 2.95.2, not 2.95.3, which is on some Rawhide mirrors: the latter's
still in beta-release mode.
> 2) Where can I get msgfmt (where's the GNU gettext package),
Same place.
> and do I care
> about the other errors?
If you get binaries, the libraries should be reasonably compatible with
other packages.
> 3) How can I tell what type of shadowed password package I'm running, and
> is util-linux-2.10h relatively safe to install on a Slackware machine?
I'm using 2.9o myself, and it seems fine to me. There's nothing
_terribly_ critical in that package, so.... (Yeah, /bin/login, that's
about it, and that doesn't change very often.)
--
= Warren -- See the *ix pages at http://www.cyberport.com/~tangent/ix/
=
= ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m
------------------------------
Date: Thu, 30 Mar 2000 02:07:17 -0700
From: Warren Young <[EMAIL PROTECTED]>
Subject: Re: Free BSD
"Peter T. Breuer" wrote:
>
> FreeBSD is spelled differently and is written by different people
> and has a different licence and different objectives and a different
> development model.
>
> Does that answer your question? If not, please explain to me the
> advantages of using BeOS instead of Plan9.
Did I accidentally stumble into rec.humor.funny while looking for Linux
info?
;->
--
= Warren -- See the *ix pages at http://www.cyberport.com/~tangent/ix/
=
= ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m
------------------------------
From: "Jerome Tollet" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking,comp.unix.programmer
Subject: Re: skb pointer problem
Date: Thu, 30 Mar 2000 12:26:42 +0100
Hello,
I had the same problem, and i resolved it by not user the struct tcphdp in
the skb, prefer the following:
struct tcphdr *th;
th = (struct tcphdr *)&(((char *)p->nh.iph)[p->nh.iph->ihl*4]);
Good luck
Jerome Tollet
[EMAIL PROTECTED]
Andreas Rennen <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi to All,
>
> I have the following problem:
> Inside of my new device-driver i have to find the protocol of a
> packet and the portnumber to do different things.
>
> In logic it looks like :
> If Customer X (IP=x) and the protocol is no 6 (TCP) and port is no 20
> (FTP-Data) then do the following...
>
> A packet "belongs" to a socket ( here sk ). In sk is a list of pointers
> with
> a buffer for each packet. Those have the structure sk_buff ( here skb )
>
> In the include-Files the structures look like:
>
> The structure of the packetbuffers is in /linux/sk_buff.h
>
> struct sk_buff{
> struct sk_buff *next;
> struct sk_buff *prev;
> struct sk_buff_head *list;
> struct sock *sk;
> ...
> union
> {
> struct tcphdr *th; /* The wanted TCP-Header */
> struct udphdr *uh;
> struct icmphdr *icmph;
> ...
> unsigned char *raw;
> } h;
> union
> {
> struct iphdr *iph; /* The used IP-Header */
> struct ipv6hdr *ipv6h;
> ...
> unsigned char *raw;
> } nh;
> ...
> };
>
> The strukture of the IP-Header is in /linux/ip.h
>
> struct iphdr {
> ...
> __u8 tos;
> __u16 tot_len;
> ...
> __u32 saddr; /* The user source-ip */
> __u32 daddr;
> }
>
> The strukture of the TCP-Header is in /linux/tcp.h
>
> struct tcphdr {
> __u16 source; /* Wanted Source-Port */
> __u16 dest; /* Wanted Destination-Port */
> __u32 seq;
> ...
> }
>
> I developed the following lines of code for my device an they work well:
>
> /* Find Customer IP - asuming that protocol is 6*/
> if( ((struct iphdr *)(skb->nh.iph))->saddr==customerip )
> {
> /* Find port number */
> if((ntohs(((unsigned int)((struct tcphdr
> *)(skb->h.th)+1)->source))==20)
> /* ntohs = net to hostbyteorder smal */
> ...
>
> What i can understand is that skb points to nh.iph and this points to
> saddr.
> In the same way i can test for the protocol. In this case the structure
> iph
> is member of the union nh.
> The short form looks like this : skb->nh.iph->saddr
>
> Ok with that - but now i want to reach the value for the sourceport over
>
> the union h by using the member th and then pointing to source
> .
> I wrote in my programmierte skb->h.th->source. And that does not work!
>
> It works only with h.th+1
> I have seen this kind of manipulation in other sources and even i do not
>
> understand this i tryed it. Know what ? - It works fine.
>
> The next sample works perfect:
>
> if((ntohs(((unsigned int)((struct tcphdr *)(skb->h.th)+1)->source))==20)
>
> /* FTP-Data = 20*/
>
> W h y i n h e l l i s t h a t + 1 ?
>
> Thank you for any help on this.
>
> Regards
> Andreas Rennen
>
------------------------------
From: Andi Kleen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking,comp.unix.programmer
Subject: Re: skb pointer problem
Date: 30 Mar 2000 13:55:41 +0200
"Jerome Tollet" <[EMAIL PROTECTED]> writes:
> Hello,
> I had the same problem, and i resolved it by not user the struct tcphdp in
> the skb, prefer the following:
>
> struct tcphdr *th;
> th = (struct tcphdr *)&(((char *)p->nh.iph)[p->nh.iph->ihl*4]);
At least in 2.2 h.th should always point to the tcphdr on output.
2.0 may have gotten it wrong.
He probably also wants to check skb->protocol == htons(ETH_P_IP) first.
-Andi
------------------------------
From: "Stewart Coomb" <[EMAIL PROTECTED]>
Subject: linker problems
Date: Thu, 30 Mar 2000 12:28:27 +0100
when compiling some code with pci_present() from pci.h using just i get this
chucked back at me:
/tmp/cchLKkUv.o: In function `main':
/tmp/cchLKkUv.o(.text+0x1e): undefined reference to 'pcibios_present'
collect2: ld returned 1 exit status
i have #include<linux/pci.h> in my code, can anyone tell me whats going on
stewart
------------------------------
From: "Gennadiy M. Kurtsman" <[EMAIL PROTECTED]>
Subject: insmod external names resolving problem
Date: Thu, 30 Mar 2000 15:08:47 +0400
Hello everybody,
my problem is following: I've written a module, calling USB driver's
procedures. When I load the module using "insmod" command I get "unresolved
symbols" error message concerning these USB driver's procedures names. This
message includes not all kernel names. For example, "printk" and "kmalloc"
are resolved. If I compile kernel including my module into compilation, all
symbols are resolved. I work with Red Hat 6.1 Linux, Kernel version
2.2.12-20. Could anybody give me a hint, what wrong with "insmod"? Thank
you,
Gennadiy Kurtsman.
------------------------------
From: "Someone Insignificant" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.development.apps,linux.dev.c-programming,linux.redhat.development
Subject: Documentation on /dev/raw
Date: Thu, 30 Mar 2000 11:31:19 GMT
Hi Everyone!
After searching endlessly on the net, looking for programming information on
the /dev/raw device, I find myself landing in usenet for the advice of
seasoned experts, as it seems their staff hasnt gotten around to documenting
this useful creature yet. ( Yes...i know i can read the source, but it never
seems a proper substitute for a well defined programming interface. )
I am currently developing an application which needs to acess a group of ide
drives ( at least 8, if not more ) in a manner that is "as fast as
possible." What I would like to do, is implement my own filesystem and
bypass the kernel whenever possible. This is necessary as very large volumes
of data are being processed.
Also, the application needs to be able to recognize partitions on the drive,
and determine the partitions geometry as best as it can. ( I know, IDE
drives have funky geometry, and translate internally. If its out of the
systems control, there is no point in worrying about it 8)
BTW...Im not stuck on the raw device usage. If there is a better/faster way,
by all means, let me know. But please dont write back saying that fputs()
should be fast enough because that simply is not the case. This particular
application needs the fastest access possible for IDE drives.
If you do know of some links you can send my way, I would be more than happy
to post the object like C code for implementing generic filesystems back to
the Linux community.
Thanks and keep on latching! ( destined to be the the slogan for the next
70's period when it hits )
mike
[EMAIL PROTECTED]
ps. Drop me an email if you can.
------------------------------
Reply-To: "onno janony" <[EMAIL PROTECTED]>
From: "onno janony" <[EMAIL PROTECTED]>
Crossposted-To:
ahn.tech.linux,alt.os.linux.dial-up,comp.os.linux.development.apps,comp.os.linux.misc,cz.comp.linux
Subject: Compile IMG
Date: Thu, 30 Mar 2000 13:54:41 +0200
How do I compile IMG??? (Like the bootimg's on the RedHat CD (initrd.img)
I want to compile a boot floppy into an IMG so I can use a dos menu to run
loadlin vmlinuz initrd=loadme.img
If you know the solution, please mail it to me @
[EMAIL PROTECTED] Thnk you!
------------------------------
From: =?iso-8859-1?Q?Rasmus_B=F8g_Hansen?= <[EMAIL PROTECTED]>
Subject: Re: software raid patch
Date: Thu, 30 Mar 2000 14:39:43 +0200
On Tue, 28 Mar 2000, D. Stimits wrote:
> It appears that the software raid 0 patch (e.g., raidtools with
> raid0145-19990824-2.2.11) is still not part of the kernel at 2.2.14.
> Anyone know if software raid for striping will be built into the
> kernel soon, since it is a time-consuming to manually adjust these
> patches to work on newer kernels?
No. It is not in the stock kernel, but at least redhat has it in their
kernel package. Else try to look at
http://people.redhat.com/mingo/raid-patches. It is also included in the
newest 2.3 kernel, which means (as far as I know), that it will be in 2.4.
BTW, if you are running software raid already, you can destroy data on
these partitions by initializing them as new raid-partitions.
Rasmus B�g Hansen
===============================================================================
,-----.
{|[;["[|=-. �l blev jo opfundet ved en fejltagelse
`|[.[ [| )) Fejltagelsen bestod i, at det ikke blev opfundet noget f�r
|[ [ [|// -- Monrad & Rislund
|[ [ [|'
`====='
------------------------------
From: "Jerome Tollet" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking,comp.unix.programmer
Subject: Re: skb pointer problem
Date: Thu, 30 Mar 2000 14:42:31 +0100
I doesn't well remember, but i think that it didn't work when i tried on a
2.2.13 and 2.2.14 kernel !
But maybe you are right
Jerome Tollet
[EMAIL PROTECTED]
Andi Kleen <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> "Jerome Tollet" <[EMAIL PROTECTED]> writes:
>
> > Hello,
> > I had the same problem, and i resolved it by not user the struct tcphdp
in
> > the skb, prefer the following:
> >
> > struct tcphdr *th;
> > th = (struct tcphdr *)&(((char *)p->nh.iph)[p->nh.iph->ihl*4]);
>
> At least in 2.2 h.th should always point to the tcphdr on output.
> 2.0 may have gotten it wrong.
>
> He probably also wants to check skb->protocol == htons(ETH_P_IP) first.
>
> -Andi
------------------------------
From: Fabrice Peix <[EMAIL PROTECTED]>
Subject: Re: Linux and Posix AIO
Date: Thu, 30 Mar 2000 14:59:03 +0200
benny wrote:
>
> Does anyone know if and when Linux will support the Posix 4 AIO
> (asynchronous I/O) facility. I have Red Hat version 2.2.5-15 and can
> not find the libaio library, so I am assuming that it is not yet
> supported?
>
> Thanks,
> Benny
asynchronous I/O are support in glibc 2.1. and not in the kernel.
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: 2.3.99pre3 - still won't compile
Date: 30 Mar 2000 14:06:34 GMT
Well, if I turn off networking it will.
Thus:
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -pipe -fno-strength-reduce -c -o ip_fw_compat_redir.o
ip_fw_compat_redir.c
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -pipe -fno-strength-reduce -c -o ip_fw_compat_masq.o
ip_fw_compat_masq.c
ip_fw_compat_masq.c: In function `do_masquerade':
ip_fw_compat_masq.c:63: structure has no member named `nat'
ip_fw_compat_masq.c:37: warning: `info' might be used uninitialized in this function
ip_fw_compat_masq.c: In function `check_for_demasq':
ip_fw_compat_masq.c:162: structure has no member named `nat'
make[3]: *** [ip_fw_compat_masq.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4pre3/net/ipv4/netfilter'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4pre3/net/ipv4/netfilter'
make[1]: *** [_subdir_ipv4/netfilter] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4pre3/net'
make: *** [_dir_net] Error 2
I don't expect beta kernels to be solid, but if the release team doesn't
care enough about quality to check that it compiles...
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
The hardest test of maturity is knowing the difference between
resisting temptation and missing a once-in-a-lifetime opportunity.
"Doing interesting things with little computers since 1979"(tm)
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: 2.3.99: what's next step?
Date: 30 Mar 2000 14:12:20 GMT
In article <8btmvk$72o$[EMAIL PROTECTED]>,
bill davidsen <[EMAIL PROTECTED]> wrote:
|
| In article <cIsE4.6053$[EMAIL PROTECTED]>,
| Jason Nye <[EMAIL PROTECTED]> wrote:
| | No, Giampaolo is right -- it looks like we're *really* close! The version
| | before 2.3.99 was 2.3.51 -- this is something significant, I think.
|
| Two of the last three "pre" releases failed to even compile without
| hacks, that is something significant:-( One had a compile problem in a
| driver (from memory) and the other was totally missing autoconf.h,
| required by the makefile and menuconfig.
As I just posted in another thread, netfilter doesn't compile in pre3,
either. I don't think "really close" and "won't even bleeping compile"
are comatible.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
The hardest test of maturity is knowing the difference between
resisting temptation and missing a once-in-a-lifetime opportunity.
"Doing interesting things with little computers since 1979"(tm)
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Crossposted-To: comp.os.linux.hardware
Subject: Re: latest 2.3.99-pre3 won't boot on I-OPENER
Date: 30 Mar 2000 14:16:03 GMT
In article <KDAE4.1189$[EMAIL PROTECTED]>,
Bryan <[EMAIL PROTECTED]> wrote:
| In comp.os.linux.hardware Rick Ellis <[EMAIL PROTECTED]> wrote:
| : Do you have frame buffers configured in you kernel? If so, try
| : turning them off.
|
| not really familiar with that section, so I left it to its default.
| which should be good, right? ;-)
I suggest going through menuconfig and disabling everything you aren't
positive you need, and putting anything you don't need to boot in a
module. Then you can either fight just the problems with non-boot, or
add features cautiously.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
The hardest test of maturity is knowing the difference between
resisting temptation and missing a once-in-a-lifetime opportunity.
"Doing interesting things with little computers since 1979"(tm)
------------------------------
From: Chad Wolfsheimer <[EMAIL PROTECTED]>
Subject: Re: Stupid Question
Date: 30 Mar 2000 14:21:40 GMT
fvw <[EMAIL PROTECTED]> wrote:
> In <8aovos$5ra$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
>>I am unable to find any information on the subject of include files. How
>>does g++ know where to look for include files (header files). In
You can add an include path with a "-I" flag, as in
"gcc -I/home/fvw/include hello.cc"
Default include paths, I believe, are compiled into the compiler. In any
case, you can see where the compiler is searching by using the "-v" flag:
"gcc -v hello.cc"
//============== Chad Wolfsheimer ===== Brown University ==============\\
//================== UNIX System/Network Administration =================\\
\\= [EMAIL PROTECTED] == [EMAIL PROTECTED] =//
\\=========== http://static-243.goddard.brown.edu/~cwolfshe ===========//
------------------------------
From: [EMAIL PROTECTED] (Aki M Laukkanen)
Subject: Re: 2.3.99: what's next step?
Date: 30 Mar 2000 14:34:35 GMT
In article <8bvnc4$kf9$[EMAIL PROTECTED]>, bill davidsen wrote:
>As I just posted in another thread, netfilter doesn't compile in pre3,
>either. I don't think "really close" and "won't even bleeping compile"
>are comatible.
Some of the patches got lost in the netfilter merge, big deal. I think they
are now in pre4-1. You should understand one thing about the development
kernels. Compilation is only tested/if at all with the configuration
Linus uses.
Anyway close is a relative term, the 2.2pre cycle took over three months
and I wouldn't expect this time it to be any different.
--
D.
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.development.system) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************