blob: c6c4739fd86b0dbe879c5e4c422b26f7b4a97204 [file] [log] [blame]
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +08001#ifndef _IPACCESS_H
2#define _IPACCESS_H
3
4#include <laf0rge1/linuxlist.h>
5
6#define IPA_TCP_PORT_OML 3002
7#define IPA_TCP_PORT_RSL 3003
8
9struct ipaccess_head {
10 u_int16_t len; /* network byte order */
Holger Hans Peter Freyther5aa17012010-07-31 04:37:26 +080011 uint8_t proto;
12 uint8_t data[0];
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080013} __attribute__ ((packed));
14
15enum ipaccess_proto {
16 IPAC_PROTO_RSL = 0x00,
17 IPAC_PROTO_IPACCESS = 0xfe,
18 IPAC_PROTO_SCCP = 0xfd,
19 IPAC_PROTO_OML = 0xff,
20};
21
22enum ipaccess_msgtype {
23 IPAC_MSGT_PING = 0x00,
24 IPAC_MSGT_PONG = 0x01,
25 IPAC_MSGT_ID_GET = 0x04,
26 IPAC_MSGT_ID_RESP = 0x05,
27 IPAC_MSGT_ID_ACK = 0x06,
28};
29
30enum ipaccess_id_tags {
31 IPAC_IDTAG_SERNR = 0x00,
32 IPAC_IDTAG_UNITNAME = 0x01,
33 IPAC_IDTAG_LOCATION1 = 0x02,
34 IPAC_IDTAG_LOCATION2 = 0x03,
35 IPAC_IDTAG_EQUIPVERS = 0x04,
36 IPAC_IDTAG_SWVERSION = 0x05,
37 IPAC_IDTAG_IPADDR = 0x06,
38 IPAC_IDTAG_MACADDR = 0x07,
39 IPAC_IDTAG_UNIT = 0x08,
40};
41
42/*
43 * methods for parsing and sending a message
44 */
45int ipaccess_rcvmsg_base(struct msgb *msg, struct bsc_fd *bfd);
46struct msgb *ipaccess_read_msg(struct bsc_fd *bfd, int *error);
47void ipaccess_prepend_header(struct msgb *msg, int proto);
48int ipaccess_send_id_ack(int fd);
49int ipaccess_send_id_req(int fd);
50
51
52#endif /* _IPACCESS_H */