PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > What's the most raw networking library?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
What's the most raw networking library?

Réponse
 
LinkBack Outils de la discussion
Vieux 27/02/2008, 18h56   #1
Tomás Ó hÉilidhe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut What's the most raw networking library?


(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?
  Réponse avec citation
Vieux 27/02/2008, 19h07   #2
Kenny McCormack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: What's the most raw networking library?

In article <31189eab-e092-47dc-8251-1cf08fb0981c@e6g2000prf.googlegroups.com>,
Tomás Ó hÉilidhe <toe@lavabit.com> 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.


To quote the great CBF, "Stop right there!"

To quote the not-so great Kenny McC:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

--
Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

  Réponse avec citation
Vieux 27/02/2008, 19h09   #3
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: What's the most raw networking library?

Tomás Ó hÉilidhe wrote:
>
> 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.
>

Just use the BSD socket API, which is ported to just about every
platform that supports networking. comp.unix.programmer would be a
better place to ask about raw mode.

--
Ian Collins.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h46.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09477 seconds with 11 queries