(I have posted this separately to comp.lang.c++ and comp.lang.c,
reason being that I'd like a response from both communities, but I
haven't cross-posted it because I think it's best not to mix C and C++
discussion)
I want to get into doing some network programming. I'd like to find a
good cross-platform networking library, but failing that, I'd settle
for something that'll work on Linux. I don't mind whether the libary
is C or whether it's C++, I'll work with either.
I don't want the library to be so raw as that I have to calculate my
own Frame Check Sequence for the frames I send, but I would like a
great deal of control, e.g. I'd like to be able to model a frame that
has a particular destination, a particular source, a particular
protocol value. And within the actual frame data, I'd like to be able
to specify whatever I want, any stream of 1's and 0's. For instance,
I'd like to model my own ARP request frame.
The machines I'll be working with will all satisfy the following
criteria:
1) CHAR_BIT == 8
2) I can specify to the compiler not to put padding between
structure members
OK so let's say I want to send an ARP request. I'd like to put
together an ARP header as follows:
typedef struct ARPHeader {
uint8 hardware_type[2],
proto_type[2],
hardware_len,
proto_len,
op[2],
src_MAC[6],
src_IP[4],
dest_MAC[6],
dest_IP[4]
} ARPHeader;
I'd then make an ARPHeader object and populate it:
ARPHeader arph = { /* blah blah blah */ };
And then I'd like to send the data out as a frame, e.g. something
like:
void LibraryFunctionForSendingFrame(uint8 dest[6],
uint8 src[6],
unsigned data_len,
uint8 const *data);
LibraryFunctionForSendingFrame(broadcast_addr,my_m ac,sizeof
arph,arph);
Is there any kind of networking library that gives me this kind of
maticulous control? Also, I want to be able to listen to the NIC to
see if I get an ARP response.
And just for kicks, is there any kind of networking library that will
give you even *greater* control than this, e.g. one that will let you
specify a dodgy frame length and a dodgy Frame Check Sequence? 3 2192
On Feb 27, 11:57 am, "Tomás Ó hÉilidhe" <t...@lavabit.comwrote:
(I have posted this separately to comp.lang.c++ and comp.lang.c,
reason being that I'd like a response from both communities, but I
haven't cross-posted it because I think it's best not to mix C and C++
discussion)
I want to get into doing some network programming. I'd like to find a
good cross-platform networking library, but failing that, I'd settle
for something that'll work on Linux. I don't mind whether the libary
is C or whether it's C++, I'll work with either.
I don't want the library to be so raw as that I have to calculate my
own Frame Check Sequence for the frames I send, but I would like a
great deal of control, e.g. I'd like to be able to model a frame that
has a particular destination, a particular source, a particular
protocol value. And within the actual frame data, I'd like to be able
to specify whatever I want, any stream of 1's and 0's. For instance,
I'd like to model my own ARP request frame.
The machines I'll be working with will all satisfy the following
criteria:
1) CHAR_BIT == 8
2) I can specify to the compiler not to put padding between
structure members
OK so let's say I want to send an ARP request. I'd like to put
together an ARP header as follows:
typedef struct ARPHeader {
uint8 hardware_type[2],
proto_type[2],
hardware_len,
proto_len,
op[2],
src_MAC[6],
src_IP[4],
dest_MAC[6],
dest_IP[4]
} ARPHeader;
I'd then make an ARPHeader object and populate it:
ARPHeader arph = { /* blah blah blah */ };
And then I'd like to send the data out as a frame, e.g. something
like:
void LibraryFunctionForSendingFrame(uint8 dest[6],
uint8 src[6],
unsigned data_len,
uint8 const *data);
LibraryFunctionForSendingFrame(broadcast_addr,my_m ac,sizeof
arph,arph);
Is there any kind of networking library that gives me this kind of
maticulous control? Also, I want to be able to listen to the NIC to
see if I get an ARP response.
And just for kicks, is there any kind of networking library that will
give you even *greater* control than this, e.g. one that will let you
specify a dodgy frame length and a dodgy Frame Check Sequence?
How about you ask in one of the 10+ newsgroups dedicated to network
programming?!
Or are you looking for another excuse to advertise your silly proposal
for the 'lets talk about every c++ library in existance' ng here
again?
On Feb 27, 12:57 pm, "Tomás Ó hÉilidhe" <t...@lavabit.comwrote:
[snip]
You can do everything that you described in your post using just BSD
sockets with SOCK_RAW types (on Windows you'd have to enumerate
protocols to find the one you want, but once you create the socket the
API is roughly the same)... see the man page: http://swoolley.org/man.cgi/7/raw
The data structures for common frame packet headers are in many system
include files already.
See Beej's guide to network programming, and the WinSock FAQ it links
to, to get a handle on cross-platformness: http://beej.us/guide/bgnet/
Start with those. That's about all the help you'll get here...
On Feb 27, 1:32 pm, Christopher <cp...@austin.rr.comwrote:
How about you ask in one of the 10+ newsgroups dedicated to network
programming?!
Jason
On 2008-02-27 18:57, Tomás Ó hÉilidhe wrote:
(I have posted this separately to comp.lang.c++ and comp.lang.c,
reason being that I'd like a response from both communities, but I
haven't cross-posted it because I think it's best not to mix C and C++
discussion)
I want to get into doing some network programming. I'd like to find a
good cross-platform networking library, but failing that, I'd settle
for something that'll work on Linux. I don't mind whether the libary
is C or whether it's C++, I'll work with either.
Perhaps BSD sockets is what you are looking for, I think they are part
of the POSIX specification which makes then available on many platforms.
They are also quite low-level and allows for using raw sockets.
--
Erik Wikström This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: James Egan |
last post by:
I've seen some networking toolkits for C++, but was wondering
if there were (or plans for) a standard set of networking
classes for C++?
Also, can someone tell me where I can find a...
|
by: Brian Keogh |
last post by:
Hi,
I'm a student learning TCP/IP networking at University. Although I
understand all about TCP/IP Networking in Java I am expected to understand
the basics of C with regard to these programs as...
|
by: H.A. Sujith |
last post by:
Why doesn't the standard library provide (at least basic)
networking facilities using TCP/IP ?
|
by: Randy Yates |
last post by:
In Harbison and Steele's text (fourth edition, p.111)
it is stated,
The C language does not specify the range of integers that the
integral types will represent, except ot say that type int may...
|
by: aaronfude |
last post by:
Hi,
I'm an experienced C++ programmer (mostly in unix and other abstract
environments such as mex). I'm now getting into Windows programming and
finding out that there are many acronyms and...
|
by: John Salerno |
last post by:
There is an article on oreilly.net's OnLamp site called "The World's
Most Maintainable Programming Language"
(http://www.oreillynet.com/onlamp/blog/2006/03/the_worlds_most_maintainable_p.html).
...
|
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= |
last post by:
(I have posted this separately to comp.lang.c++ and comp.lang.c,
reason being that I'd like a response from both communities, but I
haven't cross-posted it because I think it's best not to mix C...
|
by: Nezhate |
last post by:
Hi There !
After learning C++, I must learn gtk mm, libxml, eclipse, TCP/IP .
From what should I start?
Thanks !!
|
by: disappearedng |
last post by:
Hi guys,
I am planning to write a web crawler in standard C. I can't seem to
find standard libraries provided by C that deals with networks and
regular expression. Anyone here knows a good engine...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |