Debian Programming :: Sending Ethernet Frame Payload To Server
Nov 25, 2014
How can I send already encapsulated Ethernet frame payload to server? Basically what I would like to do is to is route Ethernet packages I get from other peripherals to their needed destinations and packets I receive send to requested device on peripheral. Program will be running on BeagleBone Black with Debian OS. Steps program should do from my point of view:
# <IPv6<UDP<DATA>>> packet received on some peripheral (UART in exact case) sent to server requested by <IPv6> destination address field# <IPv6<UDP<DATA>>> packet need to be sent to server that server application would receive <DATA> extracted from IPv6 and UDP encapsulation# <IPv6<UDP<DATA>>> packet need to be sent to server that server would know that device which is requested is available in BBB local network# <IPv6<UDP<DATA>>> packet received from server would be sent to requested device
From what I already found out I need to add routing header to packet I want to send and pass it to MAC encapsulation layer, or there is service which can add routing header and pass to other layers for me?
Also how can I get data sent from server, since if I'm not very wrong, system should receive them also encapsulated in Routing header, not as RAW data payload.
View 0 Replies
ADVERTISEMENT
Dec 3, 2010
I would like to write a program that can read every ethernet frame arriving on a specific hardware NIC, without a TCP/IP stack otherwise doing anything on that NIC. Likewise I want to be able to write out to that NIC. So every arriving ethernet frame, of all types, would be readable (probably one at a time to preserve frame boundaries). And every write of exactly that same data would send frames out. The data read and written would be the whole ethernet frame. The kernel would do nothing else with this data, but other NICs would still operate as usual.
What I would be doing is that on 2 separate NICs, copying frames from one to the other, as in bridging. But I would also be doing modifications per what my program needs to do (not at liberty to say what that would be). What facility would I need to be looking at to do this? There is no ethernet device file. Would raw sockets be able to do this? The programming language will be C.
View 4 Replies
View Related
Jun 20, 2011
I'm trying to create and send my own ETH packets from inside the kernel.My objective to send the packages from layer 2 by building my own skbuffand sending itusingdev_queue_xmit().anyone did it or have examples of how to do it ?I tried to build my own skbuff without success.
View 1 Replies
View Related
Jul 5, 2015
I recently bought a used Server (FSC RX200 S4) and set it up running Debian 7. Being used to Ubuntu, that was no big deal. It works as it should out of the box. This magic computing machine has four Network cards (eth0 - eth3). Now, I want to set it up as a multi-purpose server. On the one hand, it shall provide a Apache2 webserve, a SQL Server, a File/Streaming Server and so on. I have no problems setting up these.
On the other hand, it should work as a DHCP server in my local lan with some PCs and a printer/scanner. Until now, my cheap router did that job including to connecting me to the internet. Since I can't really set up a proper firewall with that box, I want to use my server for that.
Thats's my desired setup I want to achieve:
[] Router provides internet connection to Server
--> cable goes into eth0
[] Server therefore has a internet connection
--> Some internal magic routes the internet from eth0 to eth1 (preferably as a iptables setup) and does the Firwall & DHCP Service
--> cable goes from eth1 to a switch
--> switch connects the PCs and printer
[] PCs have internet and I can use the printer
So far so good, here's what I've come up with. I installed dnsmasq and isc-dhcp-server. I got some config files for both. I got a script to set up my iptables
Iptables script:
Code: Select all#!/bin/sh
#
# rc.firewall
# firewall with iptables ... stronger version
#
FWVER=0.88s
echo -e "
Loading STRONGER rc.firewall - version $FWVER..
[CODE].....
When starting up the services, I don't see any errors. Still, it doesn't work. My Server loses its internet connection and the PCs connected to the network are unreachable.
View 1 Replies
View Related
Oct 18, 2010
I am capturing the same traffic both on client and server. Using Microsoft Network Monitor on client and tcpdump on Linux server.
And when comparing the content of one specific frame captured on two machines, I see it different!
Precisely:
I have SIP communicator on client and opensips on server. Client is doing a REGISTER request to the server. This request contains "Contact:" header, which should contain an IP address of the machine.
When capturend on client, this header contains local private IP address of a machine with SIP communicator (which is 192.168.***). But when captured on server, this header contains the outer address of my provider's router.
I have 2 possible explanations:
1) Some unknown agent acting between my client and server
2) opensips itself is acting at a so low level, that the result of it's frame manipulation is visible by tcpdump.
I am interested if the second option is possible? opensips is a proxy, so does proxy able to manipulate frames directly in the medium?
If so, the is it possible to run tcpdump at a lower level, so that it see packets before opensips processing?
View 1 Replies
View Related
Jun 23, 2011
I have a computer with grub installed, and nothing else. I'd like to install Debian on it without having to burn a CD. (and I don't have any flash disks.) It has a nice ethernet card, and I have another computer right next to it with an ethernet card. I also have an ethernet cable. However, I don't have any router free which I can mess with for these purposes. As I've looked up, apparently modern Ethernet cards don't need crossover cables, normal cables will work for this type of connection.
I've tried several different "tutorials" on how to set up a netboot server, but
None of them are complete. All of them assume that you understand how DHCP works, and that you can do things like set up a dnsmasq server. I don't understand the DHCP protocol, with submasks and whatnot (I know that it is the protocol for assigning computer network addresses, and that's it), and I don't think I should have to in order to simply connect two computers. All of the tutorials give you incomplete configuration files, and ask you to fill in things which I don't understand, and for me it doesn't make sense to customize these settings, as I just want to connect them and I really don't care what ip address the TFTP server has or whatnot. All of these assume that you are going through a router. I am not. When I try googling for ways to directly connect two linux computers with an ethernet cable, I can't even find instructions, just more references to "you need crossover cables".
So basically, I have two computers directly connected by ethernet cables. Tell me what packages I need to install, what the contents of my configuration files should look like, and what, if any, commands I need to run in order that when I turn on my second computer, and select network boot, it will start up a minimal debian system.
EDIT: Hmmm, it looks like I actually have a linux kernel installed too, but no root filesystem (so no other programs besides busybox).
View 1 Replies
View Related
Apr 13, 2010
Ok, I have debated where to post this question. Should it be in Software? Networking? Security? Since I am going through a security class, I decided to post it here in hopes that other security gurus may have came accross the problem. Ok so, I am in a security class and they give you a wireshark capture file with RTP traffic and want you to dump the payloads into an audio file.
Pretty easy with wireshark:
Telephony -> RTP -> Show all streams...
Pick Stream -> Analyze
Save Payload
Format: RAW, Channels: BOTH -> OK
Ok so here is the problem when I do this I get: Can't save reversed direction in a file: Unsupported codec! At first I thought I was missing an audio codec it needs but I can't find it. I've searched the web and found one post that wasn't very helpful. If anyone can give me a hand that would be great.
View 1 Replies
View Related
Oct 17, 2010
I run a small home server (Debian 4), which acts as my gateway to the internet (ie, firewall) and runs a web server, dhcp, dns, and acts as a file server to the rest of the machines on my home network. Now I know it's never a smart idea to have all those services running on the same machine that is acting as a firewall, but I don't fancy running multiple servers just for home use, as it's mainly allowing me to learn system administration.
I noticed a few days ago that my internet had become unbearably slow, to the point where I could sometimes not load web pages. I spent a while searching through log files on my gateway, to try and find out what was eating up all of my bandwidth. When I came to apache's access.log file, I was confronted with this:
Code:
204.45.41.82 - - [17/Oct/2010:06:25:10 +0100] "GET http://vewice6.nightmail.ru/marriott-grand-cayma.html HTTP/1.1" 200 36921 "-" "Mozilla/4.0 (compatible; M$
204.45.41.82 - - [17/Oct/2010:06:25:11 +0100] "GET http://malaysiapodcaster.blogspot.com/2006/05/blog-post_11.html HTTP/1.1" 200 58681 "-" "Mozilla/4.0 (com$
[code]........
Multiple requests to my server, for totally random websites. I didn't even know it was possible to make those types of queries to a webserver. The only thing that is on the web server is a browser based torrent client. I have only shown a small snippet of the log file, but there are around 90k lines to different web addresses, from many different IPs. What I want to know, is what is happening? :S Why is someone querying MY web server, for web sites totally unrelated to it? And most of all, how can I stop it. My initial was to try and use iptables to block multiple requests from the same ip within a certain time frame, which I think would work as the server shouldn't really get many queries from external networks.
View 9 Replies
View Related
May 27, 2011
I'm using Squeeze Gnome.
When I watch videos within my browser, they play fine until I expand it to full screen, then the frame rate slows way down.
I've been reading related posts, If I install the gecko media player, will that solve this problem?
View 6 Replies
View Related
Mar 3, 2010
Recently I have working on an older robot that I got which happens to have an onboard computer (Versalogic VSBC-8) on which I was able to install Lenny on. This system also has a Imagenation PCX200 frame grabber installed on it as well. The problem I am having is that no matter which software I use in Lenny, webcam,etc,etc I either get an error that the device is in use or I get a blank screen, The camera that is hooked up to it works fine as I had tested it on another pc. I also verified that the permissions were set correctly for the device in /dev
I have been googling for any kind of information on how to get this working with Lenny without much luck, before I had installed Lenny it had an old version of Redhat 8 installed on it, unfortunately the hard drive died and it was replaced, hence lenny.
View 3 Replies
View Related
Aug 25, 2010
As part of a research experiment, we need to use a web proxy and direct certain users from their computers through that web-proxy. Given that we do not have access to DHCP logs (this is on a college campus), we have asked each user to go through the proxy using a different port number so we can differentiate between them. Now as a result of doing this, the entire TCP packet is encapsulated as payload data within the captured packet (using tshark to capture the packets). Now I need to be able to parse the payload for statistics including the URL. I am not sure how best to proceed. I cannot find a utility that will just output the payload and then I can probably parse the output.
View 1 Replies
View Related
May 28, 2010
I have a questions regarding iptables/netfilter and payload inspection (not headers).I have 2 servers (A and B) connected together. Server A sends information from sensors to server B.Server B process the information and send a few packets back to A.I would like to filter the packet sent back from B to A (by putting a Linux gateway in between).I know the size and the content of these packets sent to A. Is it possible to use iptables/netfilter with advanced options in order to perform the following algo:
when a packet arrive on the gateway compare the packet received on the gateway with my internal base of knowledge of payload if the packet match one of the possibility forward the packet else drop the packet endif parse the following packet received on the gateway
View 3 Replies
View Related
Apr 5, 2010
I'm looking for a way how to send an arp request / reply packet using C or C++. I've written an application that can send different crafted packages using jpcap (java), but I'm not a C expert (trying to learn). The reason for this is that I would like to port my java program to C to use it on a less powerful system that can't fully cope with the resource hungry VM
View 3 Replies
View Related
Mar 26, 2010
(Let me first of all state that I am a newbie to any form of programming.) I have been trying to create an IP header + TCP header and send this to another machine on my network.using C)I used the normal stuff: two structures for the headers, a sockaddr_in structure, call to function socket with SOCK_RAW, setsockopt with HDRINCL and call to sendto.All functions seem to return fine (values other then -1) the function that I have used to calculate the checksum for the IPheader matches the value that I manually calculated. I just don?t see the anything coming out of the interface on whireshark.I assumed that it had something do with my piece of code so I used two examples (including mixter void ru rawip html A brief programming tutorial in C for raw sockets[/url]). They show exactly the same thing functions return fine but no packets being send.I use Ubuntu 9.04 2.6.28-14-genericThe machine has two interfaces one with an ip address the other interface is in promiscuous mode. (both interfaces connected to a switch with port mirroring) I can see all normal traffic in/out.
View 2 Replies
View Related
Jan 21, 2011
I have designed and one form and php code to send mail. I am developing this in my localhost, So now i want to send email from my localhost to test my programming. I googled and i find something like editing "php.ini" file. But it didnt work for me.
View 9 Replies
View Related
Feb 26, 2011
I'm currently writing a program which will eventually send two 2d arrays to another machine using UDP, and then back again.
To do this I'm converting to a byte array which as far as I'm aware is the only way possible. I'm sure the problem is on the receiving program which receives like this:
Code:
DatagramSocket socket = new DatagramSocket(2000);
DatagramPacket packet = new DatagramPacket(new byte[5000] , 5000);
socket.receive(packet);
ByteArrayInputStream bin = new ByteArrayInputStream(packet.getData());
[Code].....
View 3 Replies
View Related
Dec 9, 2010
I have a web page that has links to a php script that sends pdf files to the browser when clicked.
The links are like this:
Code:
<a href="getfile.php?id=1201234">
The files sent are shown embedded in the browser, which is what I want.
The problem is: the title of the browser window or tab in which the pdf file is opened is "getfile.php?id=1201234"), and not the actual file name of the pdf file.
Is it possible to send the file by a php script in a way that the window/tab title becomes the filename and not the link by which it has been accessed?
View 5 Replies
View Related
Jul 16, 2009
The following piece of code is suppose to send a UDP packet.but inside function udpsocketinit , i get a segmentation fault and i can not understand why
Code:
#include <arpa/inet.h>
#include <netinet/in.h>
[code]...
View 5 Replies
View Related
Nov 29, 2010
I am coding a http server which has to send the file(s) such as images, .avi files, .mpeg, that the client is going to request. I have been trying of sending files through sockets.
char info [256];
bzero(info, 256);
//memset(&info,0,sizeof(info));
read(socket, info, 255);
write(socket, HTTP, 255);
FILE *fl= fopen(info,"rb");
fseek(fl, 0, SEEK_END);
long len = ftell(fl);
printf("largo: %ld", len);
unsigned char *ret = (char*) malloc(len);
fseek(fl, 0, SEEK_SET);
fread(ret, 1, len, fl);
However, it's supposed to be shown in Mozilla Firefox (as the client). But it is not doing it, so.. It's just not getting the complete file.
View 1 Replies
View Related
Aug 26, 2010
When I attempt to extract some webpages there are far too many jscript functions and html encodings. Hence, I can manually search the page, perform select all (^A), copy (^C) it, open a prepared file (^O), but cannot figure how to paste it (&V). I want to do this from a bash script. I know how to do the search. Now how do I send these shortcuts (especially ctrl-C) to Firefox. Once I have the page copied to the clipboard, I think I can figure out how to open a file and save the clipboard to a file using bash script on the Linux side. How do I send shortcuts to Firefox? Is this done with the hex equivalent of the keystrokes?
View 8 Replies
View Related
Aug 30, 2010
I am using centos 5, want to send a sets of binary data to other bluetooth device I know how to sent a file but dont know how to sent raw data. My case is like this I have a bluetooth device I need to send data to then after it process I need to get it back, I plan to do this all using terminal is that possible?
View 2 Replies
View Related
Jan 13, 2010
My requirement is to save files before shutting the Linux machine down, unattended ie: when the user is not near the machine. This is done whenever the UPS battery is about to die, so that the files get saved. open-Office/text-editor applications that can be saved using keystrokes will have to be found from the running processes and keystrokes should be sent to them from a C program that was started in non-graphics stage. ie: from a C program that forks into memory as a daemon before xwindows part starts. How to I send keystrokes to a running application? (like cotrol + F and then wait and then send next set of keystrokes till the file is saved as a new file or as the same file itself), either from C program or a script?
View 1 Replies
View Related
Jan 25, 2011
Im creating a perl script that will be sending out mail to mailing-lists, but im not getting it to work. Its no problem getting the script to send mail to regular mail addresses, but it doesnt seem to handle to send mail to mailing lists. Im using the Net::SMTP perl module.how to send mail from a perl script to a mailing list (and not just regular mail addresses) ?
View 2 Replies
View Related
Oct 6, 2010
My computer for a project I'm working on will be using Ubuntu with Perl and VLC from the repositories, if that matters at all. I'm not sure what I should/could use to accomplish this, but essentially I'm looking for Perl to be able to send predefined data via a serial connection based on the time within a song that VLC is playing.
A couple of the things that I've thought about after Googling a bit are SMPTE and subtitles/lyrics; I can't stop thinking that there's got so be a simple way that I'm just overlooking, though - most of the stuff I've found is for over-the-network applications, and that's overkill for this situation. All the subtitles/lyrics would have for text is hexadecimal values; all the SMPTE would do is keep Perl and VLC (playing audio) in-sync with each other. I would need either one or the other, but not both. Or, I could use something else...
I'm envisioning something like the setup below, I just don't know what else I need to make it happen.
Files:
song.mp3
timing.txt
script.pl
When I run "./script.pl song.mp3 timing.txt", VLC will open, and start playing "song.mp3", and the variable "$mils", for milliseconds elapsed, will be equal to zero. For each line in "timing.txt", the "script.pl" will assume the portion before an underscore is the "$time" for that line (time in milliseconds), and "script.pl" will assume that the portion after the underscore is the "$data", a three-byte hexadecimal value (such as "ff101f", or "011c00"), for that line.
I think that I will need to use two arrays, "@time" and "@data", such that the given line in "timing.txt" would read the same as printing: "$time[$line]".'_'."$data[$line]"."
" (if "$line" is the line number). My problem: jitter/stuttering playback. If VLC stumbles (which it sometimes does), and is a about half a second behind where it "should" be, but Perl didn't stumble, then I've got an out-of-sync issue.
Since Perl can't just count the time by itself to avoid synchronization issues, I've got two main ideas for getting this done: One way: Perl has to "read" where VLC is at, and use that as the "$mils" value. Then, if VLC delays/stubmles, so will Perl, but everything will still be in-sync. Alternative way: VLC has to "listen" to what Perl says "$mils" is at any given moment, essentially having Perl be in control of VLC's timing. This would make VLC "skip ahead" (to where it "should" be) if it starts to fall behind, thus keeping the two in sync.
I don't know which, if either, of these ways is best for my particular need. I would need "script.pl" to send "$data[$line]" over the serial connection when "$mils" == "$time[$line]". I already know how to send serial data from Perl, read files via Perl, and convert the hexadecimal number (if needed). I don't know how to "link" Perl and VLC so that they stay synchronized, and I am quite lost as to where to go from here.
View 5 Replies
View Related
Dec 17, 2010
What would be the best way to extract data by sending queries to a website?
View 2 Replies
View Related
May 19, 2010
I have a server which is used by number of client Apps. Now when a client initiates a sendto request to a server it has to respond(after recvfrom) by sending a message using sendto back to client and this should be done back and forth.
What I dont understand is, does the client have to open a new port to receive packets from client? If yes, then how will server know to what port of the client(assuming server ports are well-known to clients)?
I had given up on sending messages back and forth using UDP and switched to TCP. I could send a read and write message back and forth. But the trouble comes when I have more than one client wanting to talk to server using SOCK_STREAM. The first one gets through but the second client seems to get blocked forever(but I got no error upon socket creation or upon connect with the server on the same port as the previous client)..
View 4 Replies
View Related
Sep 9, 2010
My calling application will accept only strings and interger. we are replacing RSA bsafe library to openssl. using RSA bsafe, we have generated the private and public key in BER format. Then convert the keys, BER format into ASCII format to send the calling function. (these everything done by using RSA supplied bsafe library) same way i have to right using openssl..i m now able convert the RSA public and private key into DER format
rsa = RSA_generate_key(1024, 3, NULL, NULL);
{
size_t size;
[code]....
View 1 Replies
View Related
Mar 16, 2009
How could I (using c++ language on linux machine) put media stream (like mpeg4 movie) into the udp packets and send it to other computer in the network?
View 1 Replies
View Related
Jul 3, 2011
We have a vpn that is accessible to anyone. We already block port 25, 587 and 465. But I am still receiving spam reports. I believe that the users of my vpn is infected by a virus or something that sends spam. Are there any other ways that spammer send spam mails without using the smtp ports?
My guess is that they are trying to send it by accessing a webmail. Have you heard of anything like that? how to block spam?
View 1 Replies
View Related
Jun 29, 2010
Currently I'm having a problem with a box which keep sending spams all over the world. yesterday we upgraded some drupal modules (which can send email), and the spam quantity reduced. But still some spams keep on going out from our server. Some of them even have attachment.
Some of them sent using accounts that never exist at our server (e.g. strager@mydomain.com), and some of them are from 'nobody'. what to check, or where to look. I've check the MX-Records and there was no strange forwarders. Really stuck here...
View 9 Replies
View Related