All of lore.kernel.org
 help / color / mirror / Atom feed
* X.25 in linux
@ 2007-12-17  5:11 venkat4p
  2007-12-17 12:00 ` Matti Aarnio
  0 siblings, 1 reply; 4+ messages in thread
From: venkat4p @ 2007-12-17  5:11 UTC (permalink / raw)
  To: linux-x25


Hai all,
 
I want to make two Linux systems communicating through X.25 suite.
I am successful in sending data through X.25 PLP over lapb over
Ethernet. (by using X25 socket API, x25route and lapb0 virtual interface)
 
Now, I want to communicate via lapb over serial interface (like "ttyS0")
instead
of Ethernet layer.
I installed Net-tools package, then I tried with "slattach -p x25
/dev/ttyS0" but got message
> Cannot change line discipline to `x25'.
Can any one tell me from where can I get the modified version of "slattach" 
so that it supports X25 Async network interface or any available  modules
which helps me in doing this?
 
Thanks,
Venkat.
-- 
View this message in context: http://www.nabble.com/X.25-in-linux-tp14370077p14370077.html
Sent from the linux-x25 mailing list archive at Nabble.com.


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

* Re: X.25 in linux
  2007-12-17  5:11 X.25 in linux venkat4p
@ 2007-12-17 12:00 ` Matti Aarnio
       [not found]   ` <750297.65484.qm@web8406.mail.in.yahoo.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Matti Aarnio @ 2007-12-17 12:00 UTC (permalink / raw)
  To: venkat4p; +Cc: linux-x25

On Sun, Dec 16, 2007 at 09:11:16PM -0800, venkat4p wrote:
> Hai all,

Hello,

  
> I want to make two Linux systems communicating through X.25 suite.
> I am successful in sending data through X.25 PLP over lapb over
> Ethernet. (by using X25 socket API, x25route and lapb0 virtual interface)
>  
> Now, I want to communicate via lapb over serial interface (like "ttyS0")
> instead of Ethernet layer.
> I installed Net-tools package, then I tried with "slattach -p x25 /dev/ttyS0"
> but got message
> > Cannot change line discipline to `x25'.
> Can any one tell me from where can I get the modified version of "slattach" 
> so that it supports X25 Async network interface or any available  modules
> which helps me in doing this?

Kernel already has module  x25_asy.c  which needs to be configured from WAN
submenu - an EXPERIMENTAL module:

config X25_ASY
        tristate "X.25 async driver (EXPERIMENTAL)"
        depends on WAN && LAPB && X25
        ---help---
          Send and receive X.25 frames over regular asynchronous serial
          lines such as telephone lines equipped with ordinary modems.

          Experts should note that this driver doesn't currently comply with
          the asynchronous HDLS framing protocols in CCITT recommendation X.25.

          To compile this driver as a module, choose M here: the
          module will be called x25_asy.

          If unsure, say N.


It is not configured on in default case.
You have to make your own kernel configuration with that (and all dependencies)
turned into modules.  (You probably already did spin your own kernel to have
X.25 in system in the first place..)

Even then the  slattach  might not know what "x25" is supposed to be.

> Thanks,
> Venkat.

/Matti Aarnio

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

* Re: X.25 in linux
       [not found]   ` <750297.65484.qm@web8406.mail.in.yahoo.com>
@ 2007-12-17 12:57     ` Matti Aarnio
  0 siblings, 0 replies; 4+ messages in thread
From: Matti Aarnio @ 2007-12-17 12:57 UTC (permalink / raw)
  To: ven swe; +Cc: linux-x25

On Mon, Dec 17, 2007 at 12:25:14PM +0000, ven swe wrote:
> 
> Thanks for your reply Matti.
> 
> I already configured my kernel (version 2.6.22.8) with  "X25_ASY" .
> And I am getting the error message.
> 
> I think this is because slattach is not supporting X25.
> 
> -venkat

It should be trivialish to add that support, if same thing
is enough what SLIP and PPP do  -- turn on the serial discipline
and let driver do everything.

Current slattach man-page tells that known disciplines are:

	slip, cslip, adaptive, ppp


SLIP is really trivial thing in terms of what the slattach
command does.  External scripts and programs then do ifconfig
and other magic for the network interfaces.

You could, probably, do the required moves with e.g. few lines
of perl script.  (Or C)

/Matti Aarnio

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

* Re: X.25 in linux
@ 2007-12-17 13:51 Bahri Okuroglu
  0 siblings, 0 replies; 4+ messages in thread
From: Bahri Okuroglu @ 2007-12-17 13:51 UTC (permalink / raw)
  To: Matti Aarnio, ven swe; +Cc: linux-x25

I was playing with a modified version of X25ASY module with COM1 and  COM2 looped back on the same PC. Here is my modified version of slattach  to support x25asy but with DCE and DTE modes:  http://dreamsware.info/slattach-1.2.0a-modified-for-custom-x25asy.rar 



Basically, I've copied slip module for X25 as x25asy.c:





#include <sys/types.h>

#include <sys/ioctl.h>

#include <sys/socket.h>

#include <linux/if.h>

#include <stdlib.h>

#include <stdio.h>

#include <ctype.h>

#include <errno.h>

#include <fcntl.h>

#include <string.h>

#include <termios.h>

#include <unistd.h>

#include <linux/if_arp.h>

#include "lapb.h"

#include "support.h"

#include "pathnames.h"

#include "intl.h"

#define  EXTERN





/* Set the line discipline of a terminal line. */

static int

X25_set_disc(int fd, int disc)

{

  if (ioctl(fd, TIOCSETD, &disc) < 0) {

    fprintf(stderr, _("X25_set_disc(%d): %s\n"), disc,  strerror(errno));

    return(-errno);

  }

  return(0);

}





/* Set the encapsulation type of a terminal line. */

static int

X25_set_dte(int fd, char *lapb_mode)

{

   struct lapb_parms_struct parms;

   

   if (ioctl(fd, SIOCGIFMAP, &parms) < 0) {

      fprintf(stderr, _("Can't get LAPB parms: %s\n"),  strerror(errno));

      return(-errno);

   }

   fprintf(stderr, "lapb mode: 0x%02X\n", parms.mode);   

   if (!strcmp(lapb_mode, "dce")) {

      parms.mode = (parms.mode | LAPB_DCE);

      fprintf(stderr, "  will set to DCE");

   } else {

      parms.mode = (parms.mode & ~LAPB_DCE);

      fprintf(stderr, "  will set to DTE");

   }

   fprintf(stderr, "lapb mode: 0x%02X\n", parms.mode);   

   if (ioctl(fd, SIOCSIFMAP, &parms) < 0) {

      fprintf(stderr, _("Can't set LAPB parms: %s\n"),  strerror(errno));

      return(-errno);

   }



   return(0);

}





/* Start the VJ-SLIP encapsulation on the file descriptor. */

static int

do_x25_dte(int fd)

{

  if (X25_set_disc(fd, N_X25) < 0) return(-1);

  if (X25_set_dte(fd, "dte") < 0) return(-1);

  return(0);

}



/* Start the VJ-SLIP encapsulation on the file descriptor. */

static int

do_x25_dce(int fd)

{

  if (X25_set_disc(fd, N_X25) < 0) return(-1);

  if (X25_set_dte(fd, "dce") < 0) return(-1);

  return(0);

}







struct hwtype x25asydte_hwtype = {

  "x25asydte",    NULL, /*"VJ Serial Line IP",*/        ARPHRD_X25,     0,

  NULL,        NULL,        NULL,        do_x25_dte

};



struct hwtype x25asydce_hwtype = {

  "x25asydce",    NULL, /*"VJ Serial Line IP",*/        ARPHRD_X25,     0,

  NULL,        NULL,        NULL,        do_x25_dce

};









and updated hw.c for hwtypes[] array:



static struct hwtype *hwtypes[] = {

  &loop_hwtype,

#if HAVE_HWSLIP

  &slip_hwtype,

  &cslip_hwtype,

  &slip6_hwtype,

  &cslip6_hwtype,

  &adaptive_hwtype,

#endif

  &unspec_hwtype,

#if HAVE_HWETHER

  &ether_hwtype,

#endif

#if HAVE_HWAX25

  &ax25_hwtype,

#endif

#if HAVE_HWPPP

  &ppp_hwtype,

#endif  

#if HAVE_HWARC

  &arcnet_hwtype,

#endif  

  &x25asydce_hwtype,

  &x25asydte_hwtype,

  NULL

};





Hope this helps,







----- Original Message ----

From: Matti Aarnio <matti.aarnio@zmailer.org>

To: ven swe <venkat_p257@yahoo.co.in>

Cc: linux-x25@vger.kernel.org

Sent: Monday, December 17, 2007 2:57:42 PM

Subject: Re: X.25 in linux



 On Mon, Dec 17, 2007 at 12:25:14PM +0000, ven swe wrote:

> 

> Thanks for your reply Matti.

> 

> I already configured my kernel (version 2.6.22.8) with  "X25_ASY" .

> And I am getting the error message.

> 

> I think this is because slattach is not supporting X25.

> 

> -venkat



It should be trivialish to add that support, if same thing

is enough what SLIP and PPP do  -- turn on the serial discipline

and let driver do everything.



Current slattach man-page tells that known disciplines are:



    slip, cslip, adaptive, ppp





SLIP is really trivial thing in terms of what the slattach

command does.  External scripts and programs then do ifconfig

and other magic for the network interfaces.



You could, probably, do the required moves with e.g. few lines

of perl script.  (Or C)



/Matti Aarnio

-

To unsubscribe from this list: send the line "unsubscribe linux-x25" in

the body of a message to majordomo@vger.kernel.org

More majordomo info at  http://vger.kernel.org/majordomo-info.html











      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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

end of thread, other threads:[~2007-12-17 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-17  5:11 X.25 in linux venkat4p
2007-12-17 12:00 ` Matti Aarnio
     [not found]   ` <750297.65484.qm@web8406.mail.in.yahoo.com>
2007-12-17 12:57     ` Matti Aarnio
2007-12-17 13:51 Bahri Okuroglu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.