From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpauth05.prod.mesa1.secureserver.net (smtpauth05.prod.mesa1.secureserver.net [64.202.165.99]) by ozlabs.org (Postfix) with SMTP id 0BD79DDE32 for ; Thu, 6 Mar 2008 20:25:50 +1100 (EST) From: "Russell McGuire" To: Subject: RAW Sockets - HDLC or Ethernet Date: Thu, 6 Mar 2008 01:24:30 -0800 Message-ID: <000001c87f6b$e1d5e9e0$6405a8c0@absolut> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C87F28.D3B2A9E0" Reply-To: rmcguire@videopresence.com List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C87F28.D3B2A9E0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Anyone, Yet another mysterious question, at least to me. I have written to simple utilities to send and receive a file / data through a newly created driver, HDLC using an MPC8360E. Though I doubt this question is limited to that specific HW. The main question is that everything I send though device HDLC0 I can immediately read from HDLC0 even though logically there is no connection there. It as if the kernel is immediately allowing me to read from the same device, what a separate application just wrote.??? HOW CAN THIS BE? Details: I have two applications: send and receive. (pseudo code as follows) Send opens a socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)). And binds it (AF_PACKET, ETH_P_HLDC, if_index(hdlc0)) Receive opens a socket to the same device socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)) bind(AF_PACKET, ETH_P_ALL, if_index(hdlc0) Note they are opening the same device. Now if I send anything through the send application, I immediately receive it via the receive application?? Note, entirely separate processes! Note, there is NO hardware loopback, this should be a dead end, and I should get nothing back at least as far as HW is concerned. What am I missing, that causes all my TX data to show up immediately in the RX app? Note I have verified my HDLC drier is not actually receiving anything, so is there something in the kernel that is bridging the TX / RX paths, or am I just missing the function of this? If so how can I use RAW mode, while not mixing this, or at least keeping them separate in the applications? -Russ ------=_NextPart_000_0001_01C87F28.D3B2A9E0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable RAW Sockets - HDLC or Ethernet

Anyone,

Yet another = mysterious question, at least to = me.

I have = written to simple utilities to send and receive a = file / data through a = newly created driver, HDLC using an MPC8360E.

Though I = doubt this question is limited to = that specific HW.

The main = question is that everything I send though device HDLC0 I can = immediately read from HDLC0 even though logically there is no connection = there. It as if the kernel is immediately allowing = me to read from = the same = device, what a separate application just wrote.???

HOW CAN = THIS BE?

Details:

I have = two applications: send = and receive.  (pseudo code as = follows)

Send = opens a socket(PF_PACKET, SOCK_RAW, = htons(ETH_P_ALL)).

And = binds it (AF_PACKET, ETH_P_HLDC, if_index(hdlc0))

Receive opens a = socket = to the same device =

socket(PF_PACKET, = SOCK_RAW, htons(ETH_P_ALL))

bind(AF_PACKET, ETH_P_ALL, = if_index(hdlc0)

Note = they are opening the same device.

Now if I send = anything through the send = application, I immediately receive it via the receive application??

Note, = entirely separate processes!

Note, = there is NO hardware loopback, this should be a dead end, and I should get nothing = back at least as far as HW is = concerned.

What am = I missing, that causes all my TX data to show = up immediately in the RX = app? Note I = have verified my HDLC drier is not actually receiving anything, so is there something in the kernel that is bridging the TX / RX paths, or am I just = missing the function of this? If so how = can I use RAW mode, while not mixing this, or at least keeping = them = separate in the applications?

-Russ

------=_NextPart_000_0001_01C87F28.D3B2A9E0--