From 8cd2709ebf40805faf7e6b01cca24fe09d844cae Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 13 Jan 2010 09:06:46 +0100 Subject: [ipaccess] Create a method to send the ID ACK messages --- openbsc/include/openbsc/ipaccess.h | 1 + openbsc/src/input/ipaccess.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openbsc/include/openbsc/ipaccess.h b/openbsc/include/openbsc/ipaccess.h index 395687764..1801f6ca8 100644 --- a/openbsc/include/openbsc/ipaccess.h +++ b/openbsc/include/openbsc/ipaccess.h @@ -44,5 +44,6 @@ int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa); int ipaccess_rcvmsg_base(struct msgb *msg, struct bsc_fd *bfd); struct msgb *ipaccess_read_msg(struct bsc_fd *bfd, int *error); void ipaccess_prepend_header(struct msgb *msg, int proto); +int ipaccess_send_id_ack(int fd); #endif /* _IPACCESS_H */ diff --git a/openbsc/src/input/ipaccess.c b/openbsc/src/input/ipaccess.c index 6bd501df1..a645da85d 100644 --- a/openbsc/src/input/ipaccess.c +++ b/openbsc/src/input/ipaccess.c @@ -164,6 +164,12 @@ static int parse_unitid(const char *str, u_int16_t *site_id, u_int16_t *bts_id, return 0; } +/* send the id ack */ +int ipaccess_send_id_ack(int fd) +{ + return write(fd, id_ack, sizeof(id_ack)); +} + /* base handling of the ip.access protocol */ int ipaccess_rcvmsg_base(struct msgb *msg, struct bsc_fd *bfd) @@ -180,7 +186,7 @@ int ipaccess_rcvmsg_base(struct msgb *msg, break; case IPAC_MSGT_ID_ACK: DEBUGP(DMI, "ID_ACK? -> ACK!\n"); - ret = write(bfd->fd, id_ack, sizeof(id_ack)); + ret = ipaccess_send_id_ack(bfd->fd); break; } return 0; -- cgit v1.2.3