home *** CD-ROM | disk | FTP | other *** search
- /* AX.25 datagram (address) sub-layer definitions */
-
- /* Maximum number of digipeaters */
- #define MAXDIGIS 7 /* 7 digipeaters plus src/dest */
- #define ALEN 6 /* Number of chars in callsign field */
- #define AXALEN 7 /* Total AX.25 address length, including SSID */
-
- /* Internal representation of an AX.25 address */
- struct ax25_addr {
- char call[ALEN];
- char ssid;
- #define SSID 0x1e /* Sub station ID */
- #define REPEATED 0x80 /* Has-been-repeated bit in repeater field */
- #define E 0x01 /* Address extension bit */
- #define C 0x80 /* Command/response designation */
- };
- #define NULLAXADDR (struct ax25_addr *)0
- /* Our AX.25 address */
- extern struct ax25_addr mycall;
-
- /* AX.25 broadcast address: "QST -0" in shifted ASCII */
- extern struct ax25_addr ax25_bdcst;
-
- /* Internal representation of an AX.25 header */
- struct ax25 {
- struct ax25_addr dest; /* Destination address */
- struct ax25_addr source; /* Source address */
- struct ax25_addr digis[MAXDIGIS]; /* Digi string */
- int ndigis; /* Number of digipeaters */
- int cmdrsp; /* Command/response */
- };
-
- /* AX.25 mheard entry layout - to be qsorted by time */
- struct ax25mh {
- time_t mheard_time; /* time was last heard */
- struct ax25_addr mheard_call; /* recorded call sign */
- int mheard_digi; /* was digipeated at least once */
- };
-
- /* C-bit stuff */
- #define UNKNOWN 0
- #define COMMAND 1
- #define RESPONSE 2
-
- /* Bit fields in AX.25 Level 3 Protocol IDs (PIDs) */
- #define PID_SEGMENT 0x08 /* Segmentation fragment */
- #define PID_IP 0xcc /* ARPA Internet Protocol */
- #define PID_ARP 0xcd /* ARPA Address Resolution Protocol */
- #define PID_NETROM 0xcf /* NET/ROM */
- #define PID_NO_L3 0xf0 /* No level 3 protocol */
-
- #define SEG_FIRST 0x80 /* First segment of a sequence */
- #define SEG_REM 0x7f /* Mask for # segments remaining */
-
- /* In AX25 */
- int ax_send(struct mbuf *, struct interface *, int32, char, char, char, char);
- int ax_output(struct interface *, char *, char *, char, struct mbuf *);
- void ax_recv(struct interface *, struct mbuf *);
- void axarp(void);
-
- /* In AX25CMD */
- int doax25(int, char **);
- int doconnect(int, char **);
- void ax_parse(struct session *, char *, int16);
-
- /* In AX25DUMP */
- void ax25_dump(struct mbuf **, int);
- char *decode_type(int16);
-
- /* In AX25SUBR */
- struct ax25_cb *find_ax25(struct ax25_addr *);
- void del_ax25(struct ax25_cb *);
- struct ax25_cb *cr_ax25(struct ax25_addr *);
- int setcall(struct ax25_addr *, char *);
- int setpath(char *, char **, int);
- int addreq(struct ax25_addr *, struct ax25_addr *);
- int pax25(char *, struct ax25_addr *);
- int psax25(char *, char *);
- char *getaxaddr(struct ax25_addr *, char *);
- char *putaxaddr(char *, struct ax25_addr *);
- struct mbuf *htonax25(struct ax25 *, struct mbuf *);
- int atohax25(struct ax25 *, char *, struct ax25_addr *);
- int ntohax25(struct ax25 *, struct mbuf **);
- int16 ftype(char);
-
- /* In AX25USER */
- int send_ax25(struct ax25_cb *, struct mbuf *);
- int aprintf(struct ax25_cb *, char *, ...);
- struct mbuf *recv_ax25(struct ax25_cb *, int16);
- void disc_ax25(struct ax25_cb *);
- int ax25val(struct ax25_cb *);
- int kick_ax25(struct ax25_cb *);
- void reset_ax25(struct ax25_cb *);
-
-