Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
* Re: AX25 socket question.
@ 2002-07-16 12:19 TIMOTHY POWELL
  2002-07-16 18:17 ` Riley Williams
  0 siblings, 1 reply; 11+ messages in thread
From: TIMOTHY POWELL @ 2002-07-16 12:19 UTC (permalink / raw)
  To: tpm; +Cc: linux-hams

Thanks for the information, I didn’t realize that I
would have to work at that lower level.  But I like
challenges.  I’m looking for a book right now to get
that will help explain some things to me, I just wish
there was one specific to AX25.  I still plan to work
on the monitoring program, I had planned to get to that
lower level sooner or later but it looks like it will
be sooner.  Thanks for the help and information.   I
have always used other peoples programs before, but
after a while I finally decided to learn to do it
myself just for the challenge and learning experience. 
I appreciate all the replies.  Thanks.

Timothy
KD4IKY






On Tue, 16 July 2002, Tomi Manninen OH2BNS wrote

> 
> On Mon, 15 Jul 2002, TIMOTHY POWELL wrote:
> 
> > int socket(int domain, int type, int protocol);
> >
> > So PF_AX25 is the domain, SOCK_SEQPACKET would be
the
> > type of communication.  So what protocol is used for
> > receiving AX25 information, or am I still
> > misunderstanding sockets?
> 
> Not necessarily but maybe you're not quite up to what
the different
> protocol layers are.
> 
> Just like Craig said, when you need to have an AX.25
socket and do
> information transport between two stations, you need a
> PF_AX25,SOCK_SEQPACKET socket. AX.25 does not support
SOCK_STREAM. It does
> support unnumbered data (UI frames) with SOCK_DGRAM.
> 
> But, the point is (as far as I can see) that what you
want to do is not
> (point to point) information transfer, but network
monitoring. When doing
> that you actually do not want to have a socket that
corresponds to the
> higher level protocol but you want a socket to see
the data from the
> device driver. That is what "listen" does.
> 
> The same thing applies to applications that monitor
for example the
> internet traffic in your local ethernet segment (eg.
ethereal). They can't
> use PF_INET sockets but something lower level.
> 
> The listen program uses PF_PACKET as the domain and
SOCK_PACKET as the
> type. This is actually deprecated in new kernels but
still works (see
> packet(7) manual page for more details). Anyway the
general idea is that
> you need to interpret the raw data from the device
driver to do your
> monitoring. PF_PACKET,SOCK_PACKET socket handles the
device dependent part
> for you, basically removing the KISS command byte
when using a KISS TNC
> and maybe something else for other packet radio
drivers, but the actual
> AX.25 and higher level protocol/data interpretation
is left to you (feel
> free to copy from "listen").
> 
> So writing an application to monitor AX.25 traffic
might not be the
> easiest way to start exploring the world AX.25 as you
really need to do
> the whole protocol decoding in your application.
Writing an application
> for simple information transfer with another packet
radio station is much
> simpler as the kernel handles all the gory protocol
details for you...
> 
> But, as already said here, you can always re-use the
code from "listen".
> If you are not interested in the upper level
protocols (above plain AX.25)
> you can modify it accordingly (to just hex dump any
higher level data or
> whatever).
> 
> -- 
> Tomi Manninen           Internet:  oh2bns@sral.fi
> OH2BNS                  AX.25:    
oh2bns@oh2rbi.fin.eu
> KP20ME04                Amprnet:  
oh2bns@oh2rbi.ampr.org
> 
> -
> To unsubscribe from this list: send the line
"unsubscribe linux-hams" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
http://vger.kernel.org/majordomo-info.html

________________________________________________
PeoplePC:  It's for people. And it's just smart. 
http://www.peoplepc.com 
-
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: AX25 socket question.
@ 2002-07-15 12:24 TIMOTHY POWELL
  2002-07-15 22:38 ` Tomi Manninen OH2BNS
  2002-07-17  5:46 ` Craig Small
  0 siblings, 2 replies; 11+ messages in thread
From: TIMOTHY POWELL @ 2002-07-15 12:24 UTC (permalink / raw)
  To: csmall; +Cc: linux-hams

Thanks for the reply.

What I’m wanting to do is write a program to monitor
local packet activity.  The main goal is to learn
something new and I thought writing packet applications
would be a good start.  From your explanation and from
what I learned this weekend is that listen, listens to
more than just AX25 information which is way more than
I want to do.

My first goal is just to receive packet information and
display it on the screen.  I thought I was starting to
understand sockets but with your explanation and
questions I have discovered that I’m not understanding
as much as I had originally thought.  

int socket(int domain, int type, int protocol);

So PF_AX25 is the domain, SOCK_SEQPACKET would be the
type of communication.  So what protocol is used for
receiving AX25 information, or am I still
misunderstanding sockets?

Here might be a better idea of what I’m trying to do. 
I got an old PC that I put linux on with AX25 turned
on, for lack of a better description.  I plan to use
the sound card to receive and send packets.  First
thing I wanted to do was to write an application for
monitoring the local packet activity.  Then move to
more difficult programs as I learn more about it.  Are
there any tutorials or documentation specific to AX25
that I could also read along with studying the listen
code?  Thanks for your help.  I hope this gives you a
better idea of what I want to do.

Timothy


On Mon, 15 July 2002, Craig Small wrote

> 
> On Sun, Jul 14, 2002 at 12:01:11PM -0700, TIMOTHY
POWELL wrote:
> > Got a question about the below code copied from the
> > listen.c file that came with ax25-apps-0.0.4
> > 
> > if ((s = socket(AF_PACKET, SOCK_PACKET,
htons(proto)))
> 
> listen is doing a low-level (Packet socket)
connection.  This is because
> it wants to receive all traffic.  Quite often you
don't want something
> as low-level as that.
> 
> > I'm new to sockets so I'm a little confuse.  From
what
> > i read from the man pages about sockets if i want to
> > create a socket for ax.25 I would do something
similar
> > to the following:
> > 
> > axsock = socket(PF_AX25, SOCK_STREAM, <?>) ;
> 
> This would make a socket with the protocol family of
AX25 and a type of
> STREAM.  AX.25 connections are usually SOCK_SEQPACKET
 I don't think
> STREAMs are defined in AX25 land.
> 
> > I am assuming that AF_PACKET and SOCK_PACKET, used
in
> > the first piece of code, are just variables used by
the
> > programmer to create any type socket he wanted,
since I
> > couldn't find metion of them in the man pages or any
> Not really, it comes to what protocol level the
packets come in at.
> PACKET is pretty low level, I think SOCK_RAW is lower
still though I
> cannot see the difference between them.
> 
> > way i wrote the function except for <?> if all i
want
> > to do is create a socket for AX25?  <?> is where the
> Create a socket for AX25 to do WHAT?  The what is the
essential piece of
> information you are missing and it what we need to
help you.
> 
> >  I tried to find the function 
> > htons(proto) in the code but couldn't so I'm not
sure
> htons? Host to Network (byte order) for Short ints?
> Makes sure the bits are the right way around, intel
gets them back to
> front.
> 
> > which protocol to use with AX25.  I looked in the
file
> > /ect/protocols but didn't see anything for AX25, but
> /etc/protocols are the protocols that ride on top of
IP
> As you're playing around "below" IP so it won't help
you.
> 
> As someone said before, have a look at the existing
code.  It may not be
> perfect but it works and gives you a good start.  I
can tell you more
> specific things to look at once we know what you're
trying to do.
> 
>  - Craig
> -- 
> Craig Small VK2XLZ  GnuPG:1C1B D893 1418 2AF4 45EE 
95CB C76C E5AC 12CA DFA5
> Eye-Net Consulting http://www.eye-net.com.au/       
<csmall@eye-net.com.au>
> MIEEE <csmall@ieee.org>                 Debian
developer <csmall@debian.org>
> -
> To unsubscribe from this list: send the line
"unsubscribe linux-hams" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
http://vger.kernel.org/majordomo-info.html

________________________________________________
PeoplePC:  It's for people. And it's just smart. 
http://www.peoplepc.com 
-
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread
* AX25 socket question.
@ 2002-07-14 19:01 TIMOTHY POWELL
  2002-07-15  0:03 ` Craig Small
  0 siblings, 1 reply; 11+ messages in thread
From: TIMOTHY POWELL @ 2002-07-14 19:01 UTC (permalink / raw)
  To: linux-hams

Got a question about the below code copied from the
listen.c file that came with ax25-apps-0.0.4

if ((s = socket(AF_PACKET, SOCK_PACKET, htons(proto)))
== -1) {
		perror("socket");
		return 1;
	}
I'm new to sockets so I'm a little confuse.  From what
i read from the man pages about sockets if i want to
create a socket for ax.25 I would do something similar
to the following:

axsock = socket(PF_AX25, SOCK_STREAM, <?>) ;

I am assuming that AF_PACKET and SOCK_PACKET, used in
the first piece of code, are just variables used by the
programmer to create any type socket he wanted, since I
couldn't find metion of them in the man pages or any
where else.  In my example, axsock, am I correct in the
way i wrote the function except for <?> if all i want
to do is create a socket for AX25?  <?> is where the
protocol is sure post to be, which protocol do you use?
 I tried to find the function 
htons(proto) in the code but couldn't so I'm not sure
which protocol to use with AX25.  I looked in the file
/ect/protocols but didn't see anything for AX25, but
there was one for radio.  Can some one give me 
a little incite on how to create a socket just for
AX25?  Thanks I'll keep looking over the code and
reading to try and learn as much as possible.  Thanks.

Timothy 
KD4IKY

________________________________________________
PeoplePC:  It's for people. And it's just smart. 
http://www.peoplepc.com 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-07-17  5:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-16 12:19 AX25 socket question TIMOTHY POWELL
2002-07-16 18:17 ` Riley Williams
2002-07-16 20:23   ` jeff
2002-07-16 21:38     ` Riley Williams
2002-07-17  1:07     ` Bob Nielsen
2002-07-17  0:55   ` Bob Nielsen
  -- strict thread matches above, loose matches on Subject: below --
2002-07-15 12:24 TIMOTHY POWELL
2002-07-15 22:38 ` Tomi Manninen OH2BNS
2002-07-17  5:46 ` Craig Small
2002-07-14 19:01 TIMOTHY POWELL
2002-07-15  0:03 ` Craig Small

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox