home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff225.lzh / AmigaTCP / src / ax25.h < prev    next >
C/C++ Source or Header  |  1989-06-24  |  2KB  |  54 lines

  1. /* Control field templates */
  2. #define    I    0x00    /* Information frames */
  3. #define    S    0x01    /* Supervisory frames */
  4. #define    RR    0x01    /* Receiver ready */
  5. #define    RNR    0x05    /* Receiver not ready */
  6. #define    REJ    0x09    /* Reject */
  7. #define    U    0x03    /* Unnumbered frames */
  8. #define    SABM    0x2f    /* Set Asynchronous Balanced Mode */
  9. #define    DISC    0x43    /* Disconnect */
  10. #define    DM    0x0f    /* Disconnected mode */
  11. #define    UA    0x63    /* Unnumbered acknowledge */
  12. #define    FRMR    0x87    /* Frame reject */
  13. #define    UI    0x03    /* Unnumbered information */
  14. #define    PF    0x10    /* Poll/final bit */
  15.  
  16. /* FRMR reason bits */
  17. #define    W    1    /* Invalid control field */
  18. #define    X    2    /* Unallowed I-field */
  19. #define    Y    4    /* Too-long I-field */
  20. #define    Z    8    /* Invalid sequence number */
  21.  
  22. /* Format of an AX.25 address - left-shifted callsign plus sub station ID */
  23. #define    ALEN    6    /* Number of chars in callsign field */
  24. struct ax25_addr {
  25.     char call[ALEN];    
  26.     char ssid;
  27. };
  28. /*
  29.  *  It seems that some compilers (on VAX and 68K hardware) round up 
  30.  *  structure sizes to quad- or double-byte boundaries.  Hmm..
  31.  */
  32. /* AX.25 address length (7 bytes) */
  33. #define    AXALEN        (ALEN+1)    /* (sizeof(struct ax25_addr)) */
  34.  
  35. /* SSID address byte definitions */
  36. #define    SSID        0x1e    /* Sub station ID */
  37. #define    REPEATED    0x80    /* Has-been-repeated bit in repeater field */
  38. #define    E        0x01    /* Address extension bit */
  39. #define    C        0x80    /* Command/response designation */
  40.  
  41. #define    UNKNOWN        0
  42. #define    COMMAND        1
  43. #define    RESPONSE    2
  44.  
  45. #define    PID_ARP        0xcd    /* AX.25 Level 3 PID for ARP */
  46. #define    PID_IP        0xcc    /* AX.25 Level 3 PID for IP */
  47. #define PID_NETROM    0xcf    /* AX.25 Level 3 PID for NET/ROM frames */
  48.  
  49. /* Our AX.25 address */
  50. extern struct ax25_addr mycall;
  51.  
  52. /* AX.25 broadcast address: "QST   -0" in shifted ASCII */
  53. extern struct ax25_addr ax25_bdcst;
  54.