Networking :: NETFILTER And Extraction Of Data From Non Linear Area Of Skbuff

Feb 25, 2011

i am writing a netfilter module for linux 2.6.34.6-47 / 2.6.35. while i could capture the packets on the incoming hook since the same came as a single packet in probably the allocated skbuff area by the stack, i found that packets going out of the machine are getting splitted into linear and non-linear area. skb->data gives the total length of packet as correct, but when i extract skb-> data to print it, it prints only ip and tcp header. Now to treat the data i need to extract it and then push it back on the route.

To clarify if my data is 3 bytes . the total length by passing pointers show as 55 bytes = ( 52 byte of header + 3 byte of data), but i can't access these 3 bytes by using skb->tail - skb->data. how to extract outgoing data for any further action and then put it back on route for further encapsulation by the L2 stack or whatever. will skb_linearize() or skb_linearize_cow() be of any use , if yes how and why?

View 1 Replies


ADVERTISEMENT

Programming :: Implement (linear Data Structure) Queue In Shell Script?

Jun 21, 2010

I am in deeply need of queue (linear data structure) in shell script. How can I implement this ??

View 2 Replies View Related

Software :: Networking Skbuff And Qdisc?

Oct 23, 2010

Why can not use skb_queue of skbuff to enqueue and dequeue within qdisc in kernel programming? Also, I cannot find the source code of *enqueue of qdisc in LXR. Anyone understands qdisc and skbuff in kernel well?

View 1 Replies View Related

Networking :: Netfilter: Connection Tracking Bandwidth Accounting?

Dec 10, 2010

On Kernel 2.6.33.4 I get this from /proc/net/ip_conntrack:

tcp 6 431557 ESTABLISHED src=X.X.X.X dst=X.X.X.X sport=44242 dport=993 packets=128 bytes=9267 src=X.X.X.X dst=X.X.X.X sport=993 dport=44242 packets=85 bytes=53950 [ASSURED] mark=0 use=2

On Kernel 2.6.36.2 I get this from that same file:

tcp 6 431665 ESTABLISHED src=X.X.X.X dst=X.X.X.X sport=4640 dport=8082 src=X.X.X.X dst=X.X.X.X sport=8082 dport=4640 [ASSURED] mark=0 use=2

It's missing the data on bytes and packets transmitted through that particular connection. I had written a program that uses this information. Was this pulled out of the kernel on purpose or did I miss some option when compiling the new kernel for my box?

View 1 Replies View Related

Networking :: Netfilter's -state INVALID Triggered By Foreign Dual WAN Routers?

Dec 22, 2010

Recently I am logging the packets that are supposedly INVALID and I found out that I am dropping a lot of packets that seem legitimate (in the sense that they are clients that are allowed to contact us).

Code:
:invalid - [0:0]
-A invalid -j LOG --log-prefix "[DROP INVALID] : " --log-tcp-options --log-ip-options
-A invalid -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT

[Code]...

I would like to know If I can tell a complaining client that his dual-WAN solution is not behaving properly.Should such a dual WAN-router spoof its IP to the one that initiated the connection? And what happens if these packets are not dropped? Will they be accepted by the application or does it depend on the application? It sounds like a security risk if it does. It seems to me those packets will be ignored anyway by the application Netfilter's manual says that it's safe to drop these packets.

View 1 Replies View Related

Programming :: Convert Urb To Skbuff?

Nov 30, 2010

I am trying to write a kernel module which is the combination of the usb driver and a network driver, now whenever the data is recieved by the usb driver it will be in struct urb, but the data that is required by the net driver is sk_buff, now how do i convert a urb to sk_buff, i found something similar is being done in the phonet protocol, but i couldnt understand, howexactly this is being done. Can someone explain this code.

drivers/net/usb/cdc-phonet.c
Code:
static void rx_complete(struct urb *req)
{
struct net_device *dev = req->context;
struct usbpn_dev *pnd = netdev_priv(dev);

[Code]....

View 1 Replies View Related

Ubuntu :: Best Non-linear Video Editing Program?

Jan 14, 2010

i tried kdenlive but it conflicts with pidgin and rhytmbox

View 2 Replies View Related

General :: Linear Hashing Implementation In C Language?

Dec 7, 2010

I'm looking for linear hashing implementation in C language. PS: I have to implement this on Ubuntu 10.04 Linux on 64 bit machine.

View 2 Replies View Related

General :: Find No Way Of Choosing Whether Linear Or Striped?

Feb 19, 2010

I have two drives (sde 120Gb) and sdh(250Gb) which I want to use for the following setup: sde + 120Gb of sdh as a striped LVM as an ext4 partition remaining 130Gb of sdh as a separate ext4 partition I am able to use the build in partition manager in Mandriva to set up the rest of my disks and I can set up an LVM as planned above, but I find no way of choosing whether it should be linear or striped. This means I will most likely have to do it from the command line. Can someone tell correct commands to set it up?

View 6 Replies View Related

Hardware :: PCMCIA Linear Flash - Read And Write To The Card

Mar 4, 2011

The card in question is a PC Card (PCMCIA) 16Bit Intel Series 2 Flash Memory Card (2MB) and I want to be able to read from and write to the card. I've rebuilt latest stable kernel (2.6.37.2) with all the PCMCIA options turned on or built as modules. I've got an SRAM card, a CompactFlash Card (in a CF to PC-Card adapter) and the Linear Flash card to try, the SRAM card I'm not expecting greatness from, but hoping to prove that the slot works (it registers, but doesn't get much reported from lspcmcia). The CF card in the adapter works. I'm expecting to see a block device in /dev but nothing appears lspci:

[Code]....

View 11 Replies View Related

Software :: Mdadm 2.6.4 - Adding Disk To Running Linear Array

Jan 31, 2010

I am using mdadm 2.6.4 for managing RAIDs on Linux kernel 2.6.18. I've a query like whenever I tried to add a new disk to a running linear array(JBOD)i get a message "cannot add new disk to this array".

The exact steps are as follows:
create a new array as:
mdadm -C /dev/md0 -llinear -n2 /dev/sata/ /dev/sata2
It is getting added and i am able to see with -D command.

Now add a new disk sata3 as follows:
mdadm --grow /dev/md0 --add /dev/sata3 I get the output as:
md: sdb has invalid sb, not importing!
md: md_import_device returned -22
mdadm: cannot add new disk to this array.

So my first doubt is whether mdadm 2.6.4 supports this features or not if it supports then do I need to change the driver?

View 3 Replies View Related

Debian :: Iptables - Netfilter Queue Handling

Jul 17, 2015

I have created a nfq handler via nfq_open() and using the returned qhandle to bind my application program to a specific queue number that is configured in iptables. when i invoke nfq_create_queue() my program is stuck there and the back trace shows it is blocked in recvfrom()

bt

in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0
in nfnl_recv () from /usr/lib/libnfnetlink.so.0
in nfnl_catch () from /usr/lib/libnfnetlink.so.0

View 0 Replies View Related

Debian Installation :: How To Install Netfilter / Iptables

Apr 5, 2011

How to install netfilter/iptables ? debian6

View 1 Replies View Related

Networking :: Why Ethernet Is Used Only In Local Area Network?

Dec 25, 2010

One question that weight a lot of points was about ethernet... the professor asked why ethernet is used only in local area network? resuming i wrote that ethernet is used only in LAN because it is shared and so for big network there could be a lot problem in using the shared channel.. for istance using protocol such as CSMA/CD, if a big network has a lot of hosts, they could wait a long time before sending...is it right or am I wrong?

View 7 Replies View Related

Security :: Netfilter Conntracking For P2P Protocols - Edonkey - Bittorent

May 17, 2009

I would like to allow multi users to access P2P networks, so I wonder if there's a way to tracking these kind of protocols with netfilter, and also compatibility with nat, like the module conntrack_ftp seems to do with the FTP protocol.

View 3 Replies View Related

Networking :: Serial Port : Read Data, Not Reading Complete Data?

Mar 5, 2010

I have an application where I am sending data via serial port from PC1 (Java App) and reading that data in PC2 (C++ App). The problem that I am facing is that my PC2 (C++ App) is not able to read complete data sent by PC1 i.e. from my PC1 I am sending 190 bytes but PC2 is able to read close to 140 bytes though I am trying to read in a loop.Below is code snippet of my C++ AppOpen the connection to serial port

Code:
serialfd = open( serialPortName.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
if (serialfd == -1)

[code]...

View 5 Replies View Related

Ubuntu Networking :: Nm-applet Removed From Notification Area?

Oct 22, 2010

After upgrading to Kubuntu 10.10 the icon for the gnome-network-manager (which I had installed instead of the former knetworkmanager) does not show up.

Although I can connect to the Internet, I am not able to set up my VPN without an icon showing up.

Checking at the terminal indicates that there is indeed something wrong here:

Code:
sovonet@sovonet:~$ nm-applet
** Message: applet now removed from the notification area
** (nm-applet:3027): DEBUG: old state indicates that this was not a disconnect 0

[Code].....

View 6 Replies View Related

Debian Configuration :: Message Package Netfilter-persistent Is Not Configured Yet

Sep 3, 2015

I installed few days ago Debian Jessie (Linux server-1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux) for some tests.I tried to install iptables-persistent with the command "apt-get install iptables-persistent".During the install process, I got the following message :

Code: Select allPreconfiguring packages ...
Selecting previously unselected package netfilter-persistent.
(Reading database ... 31677 files and directories currently installed.)
Preparing to unpack .../netfilter-persistent_1.0.3_all.deb ...
Unpacking netfilter-persistent (1.0.3) ...
Selecting previously unselected package iptables-persistent.

[code]....

Some talks about cups, acpid, ipv6 or systemd but nothing has solved the issue in my case.I used iptables-persistent many times with older debian versions.

View 6 Replies View Related

Programming :: Configure Netfilter By Importing A Text File With C++ Language

Feb 27, 2010

Well my problem is that i want to configure Net filter (FORWARD) not manually but by importing a text file which may contain a binary array with c++ language like :

0 0 1
1 1 0
0 0 1

with 0 is "IPTABLES -A FORWARD -p udp -j ACCEPT"

and 1 is "IPTABLES -A FORWARD -p udp -j DROP"

so after importing i want to find in my firewall 9 rules equal to the numbers of the binary array.

View 1 Replies View Related

Software :: Can't Do Extraction Using Tar Command

Jul 9, 2010

I am able extract the file "hurd-live-cd-20051117.iso.gz" using file-roller but i cannot do it using tar command ,i gave the command tar -xzvf hurd-live-cd-20051117.iso.gz although it exited without error the file is not extracted what is the correct options to use to extract the file?

View 5 Replies View Related

Ubuntu Networking :: Wifi Icon Disappeared From Notification Area?

Jun 2, 2010

While my wifi still is working just fine (I'm here aren't I), the Network Manager has disappeared from the Notification Area on my panel upon reboot.Have all current patches, so have no clue what to do. Most likely is a bug.

View 1 Replies View Related

Ubuntu Servers :: Iptables / Netfilter Config Stops Sendmail From Working?

Oct 8, 2010

I have an ubuntu server virtual machine with a webhost. I am trying to configure the firewall. I am having a problem with sendmail and the required firewall configuraiton If I type the command:

iptables -F

Then sendmail works perfectly. I can see the emails sent in my googlemail inbox. I then configure my firewall as follows:

iptables -F
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp --dport 2252 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
[Code]....

(I have moved SSH to a diffrent port) Once this is setup sendmail no longer works. I had assumed that sendmail will establish a tcp connection and the first rule will allow all established connections to pass. why this iptables/netfilter config stops sendmail from working.

View 5 Replies View Related

Ubuntu Networking :: Network Manager Applet Disappears From Notification Area

Jan 28, 2010

On about 90% of bootups I find that network manager has disappeared from the notification area to be replaced by a random duplicate of one of the other icons (at random). If I remove the notification area and add it again all is fine.

View 9 Replies View Related

Ubuntu Networking :: Network Manager Not Displayed On System Notification Area

Apr 13, 2010

am new to ubuntu, have some issues with connecting to wireless. I have downloaded my wireless drivers and installed, I can see that my wireless is on from the indicatior, but I cant connect to any wireless access point because I cant locate network manager on the notification area. Am using Dell inspiron 1501.The second issue I have is connecting as root. after I installed ubuntu, it created a user for me which I specified during installation, but most things am doing requires root privilleges. I cant connect as root because I dont know root password, I have tried changing the password but it doesn't go. Pls guys help me sort out these issues.

View 2 Replies View Related

Ubuntu Networking :: Network Manager Doesn't Show Up In Notification Area

Jun 8, 2010

im just getting the hang of ubuntu 9.10, and then all of a sudden 10.04 comes over and screws everything up with the upgrade. i did the upgrade, and now the network manager wont show up in notification areas. any clue as to why? help is greatly appreciated. also, my machine does register that the drivers for wireless card is installed, and when i run lshw -c net command with sudo priveleges, it says it can detect networks, so im confused as hell.

View 9 Replies View Related

General :: Which Directory Mpc / Gmp / Mpfr Store After Extraction

Feb 20, 2011

I'm trying to do a linux from scratch build (using the livecd) and am currently trying to compile and install gcc. However, this error keeps popping up: checking for correct version of gmp/mpfr/mpc libraries...no I've tried all the possible directories I can find for each one, but as the error doesn't specify which particular library it can't find it makes life pretty difficult =/ This is my current string:

[code]....

It took me long enough to find the .h files and I thought it was finally over with, but now this

View 2 Replies View Related

Programming :: Bash Regex String Extraction?

Jun 10, 2011

Code:
g echo ${mm[$j]}
4 BashNotes

[code]...

View 2 Replies View Related

Programming :: Tar *.gz/.bz2 Extraction - Deploy With Bash Script

Apr 5, 2010

I thought of a command that would make my life easier, though I do not know how to deploy it with bash script. The idea- A simple script that would check in a the current directory for *.bz2 or *.gz files,and when finds one of those,or both - execute a tar -xvf *.bz2/*.gz following the files that have been found there. It should be very simple,as I am very new to bash,I can`t figure that out. I wrote :

[Code]....

The idea ls command that would find *.gz files in the current dir,then it outputs the errors to ./tmp.txt, if there were no errors = a tar.gz archive found,tmp.txt will be blank,hence the cat command that checks the file. The wrong - I couldn`t succeed with the "cat 'tmp.txt' == '' ;" ,as cat command searches == as a file and it fails.

View 5 Replies View Related

Ubuntu Networking :: How To Share/Mount Hard Drives Over A Local Area Network

Mar 19, 2011

I have a computer, the one I am on now, with Ubuntu 10.10, it should be completely updated... and I can network with other computers, I can access Windows XP and 7 shared locations on other computers, and I can also get Ubuntu on other computers to access this computer's shared files.What I can't do, however, is share my hardrives that are on this computer, I have tried sharing them in /media/ and etc, but it is not working, apparently you have to mount them in some mystical way.

Another problem is getting Windows machines to access Ubuntu computers on the network - which I believe is a Windows problem, so I can figure that out some other time, but importantly, I want to be able to share my hardrives over the network.

If someone can give me some instructions to mounting and sharing hardrives(internal), and even my DVD-Drives, and portable USB devices, would also be fantastic - since, in Windows you can just right click, "share", and it's done.. It is a very useful thing to have, and I don't want to use Windows on this computer anymore, but I have no choice, really, if I can't share my storage to the other computers.

View 4 Replies View Related

Security :: Netfilter Hook - Kernel Module - Skb_transport_header - Tcphdr Fields Wrong Values

Apr 1, 2010

We are trying to implement a firewall as kernel module through netfilter hooking (in C). In the following code we are allowing only TCP traffic. Source port number and destination port number are printed for every TCP packet. On execution, this code prints wrong port numbers. This is the first time we are using skb_transport_header function for accessing tcp headers.

We verified port numbers being printed by firewall through NFS traffic. On the same machine where firewall is running, we hosted an NFS server. An NFS client (from a different system) puts a file in exported mount. Firewall is able to capture packets for this file transfer but port numbers printed are wrong. It prints '69' for source portnumber (whereas ethereal capture shows it as 790) and prints '553231' for destination port (whereas for nfs version 4 it has to be 2049).

[Code]....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved