LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2006, 08:24 AM   #1
aashish.verma
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Rep: Reputation: 0
[ urgent]Packet filter using Source MAC address


hi all,

Actually i have implemented packet filter using IP address... so i just thinking to implement the same with the MAC address..
how we will compare source mac address with the specific mac address?
the copy of source mac address is in the sk_buff structure,it is pointed by the data pointer.
but how we will compare the two addresses.
i am using C language ..
i need it urgent..
plz reply soon..

Thanks
 
Old 06-01-2006, 11:40 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
You do realize that the linux kernel impliments packet filtering? In the 2.4 & 2.6 kernels this includes the ability to match on MAC addresses.
 
Old 06-01-2006, 12:49 PM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
So what do you have...

Do you have the MAC address or do you want to know how to get it?
Is your problem trying to work out how to do a compare?
 
Old 06-02-2006, 12:04 PM   #4
aashish.verma
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Original Poster
Rep: Reputation: 0
hello graemef,

ya my problem is how to compare the mac address which is stored in the Sk_buff structure?

I think we can get MAC address from Union mac from Sk_buff structure.
i am using this code for my project.. so plz help me...
 
Old 06-02-2006, 12:56 PM   #5
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Take a look at this thread, hopefully it will help you.
 
Old 06-03-2006, 02:54 AM   #6
aashish.verma
LQ Newbie
 
Registered: Apr 2006
Posts: 11

Original Poster
Rep: Reputation: 0
hi Graemef,

Thanks for your help..i got the code which i am looking for...
the link u have sent is useful.. but when i tried the code it is not giving proper output..

By the way , i used struct Sk_buff's union mac to get the source address and then compare it with the MAC address specified.

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting MAC address from Ethernet packet in C++ eljofi Programming 9 10-13-2013 02:21 AM
Packet Filter to redirect a packet to a user level process akawale Linux - Networking 3 09-01-2006 12:06 PM
Packet filter using MAC Address aashish.verma Linux - Networking 1 05-30-2006 07:41 AM
how source address can be changed in packet payal_shah Linux - Networking 3 03-29-2005 06:56 AM
Need to filter devices out from a firewall by MAC address bhenry Linux - Security 3 10-07-2004 11:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration