Please don't use the driver to do this kind of thing, everything you want to do 
can be done using iptables.  In fact I would suggest that you simply use squid 
and NAT to provide the services you mention.

Jesse

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zheng yong
Sent: Tuesday, July 08, 2008 6:24 AM
To: [email protected]; Linux NICS
Subject: [E1000-devel] I want to transfer packet in e1000 driver,how?

Hi everybody!
I have a linux(Fedora 9) machine with two net
cards,one card for outer connection with internet,and
another for inner connection to intranet.
I will let only tcp packet with a port 80 pass from
outer to inner and from inner to outer.
To ease,I want to edit the e1000 driver,transfer ARP
packets and some TCP packets.
Here are what I have done:
1. declare two static struct net_device *
varibles,named kdn_e1000_outer and kdn_e1000_inner

2. in function e1000_probe, initialize the two
varibles.

3. write a function deal packet:
static boolean_t kdn_e1000_deal_packet(struct
net_device *netdev, struct sk_buff *skb);

4. in function e1000_clean_rx_irq and
e1000_clean_rx_irq_ps, I substitute the call to
netif_rx and netif_recieve_skb with
kdn_e1000_deal_packet

and then,here is the questions:

1.before I call e1000_xmit_frame, what should I do
with the skb?
if it is a ARP req or resp, I substitute the mac in
ethernet header and the mac in arp content.
if it is a tcp packet, I substitute the mac in
ethernet header.

Are there any else?

2.while the struct net_device *netdev in function
e1000_clean_rx_irq and e1000_clean_rx_irq_ps has
unstable field perm_addr? It should be fixed for one
net card,isn't it?

3.why is the arp packet I received wrong, I mean it is
not the same with the one sent.
for example:
arp sent has content:
00:0D:60:66:12:69     192.168.111.2    00:00:00:00:00 
192.168.111.1

while the one received has content:
FF:FF:FF:FF:FF:FF        192.168.111.2   
00:0D:60:66:12:69   192.168.111.1

it is wild.

I am longing for the answers,thank you for all.
here is the source code e1000_main.c in accessory


      ___________________________________________________________ 
 雅虎邮箱,您的终生邮箱! 
http://cn.mail.yahoo.com/

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel

Reply via email to