linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ron Michael Khu <ronkhu@ntsp.nec.co.jp>
To: "Igor A. Deruga" <ingvarrr@hotbox.ru>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Raw Sockets
Date: Sun, 19 Dec 2004 19:07:54 +0800	[thread overview]
Message-ID: <41C5610A.7030207@hq.ntsp.nec.co.jp> (raw)
In-Reply-To: <200412191119.14034.ingvarrr@hotbox.ru>

i dont know how to use raw sockets....
but u could try using "ifconfig" (located usually in the /sbin directory)
to get the mach address...

*the mach address(or hwaddr is usually shown on the first line
of the output)

hope this helps.


Igor A. Deruga wrote:

>Greetings, fellows!
>
>Hope you'll be able to help me with your useful advice...
>I need to establish a connection using a Raw socket. That's what I'm doing:
>
>int sock = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW);
> sockaddr_ll addr;
>        addr.sll_family = AF_PACKET;
>        addr.sll_protocol = 0;
>        addr.sll_ifindex = 0;
>        addr.sll_hatype = 0;
>        addr.sll_pkttype = 0;
>        addr.sll_halen = 0;
>
>But where can I get a value for addr.sll_addr? And what is it? "man 7 packet" 
>sais it's a Physical layer address, which is MAC, i guess... so, how do I 
>retreive it?
>
>If it's possible, could anybody send me an example that uses sockaddr_ll to 
>SEND packets via RAW SOCKET? That'd be great!
>
>Sincerely 
>        Igor	
>
>
>P.S.: I've set the encoding to iso-8859-5. Hope this time it goes through...
>-
>To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>  
>



      reply	other threads:[~2004-12-19 11:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-19  4:19 Raw Sockets Igor A. Deruga
2004-12-19 11:07 ` Ron Michael Khu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41C5610A.7030207@hq.ntsp.nec.co.jp \
    --to=ronkhu@ntsp.nec.co.jp \
    --cc=ingvarrr@hotbox.ru \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).