Changeset 9442c1b9bad3426ece07edc7fa2dca7464fc302a
- Timestamp:
- 02/20/10 00:38:20 (5 months ago)
- Author:
- Holger Hans Peter Freyther <zecke@selfish.org>
- Parents:
- 4d2d95b35addba99a7927041554d50ed7452fd7c, e2c5028dc4ca8b3f9f4846b658a9b80ec3e70f4d
- Children:
- dfe6c7d910edbba238751d0cfddbb627bb08ef54
- git-committer:
- Holger Hans Peter Freyther <zecke@selfish.org> / 2010-02-20T00:38:20Z+0100
- Message:
-
Merge branch 'on-waves/sccp'
- Location:
- openbsc
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r62c87b5
|
r9442c1b
|
|
| 210 | 210 | offsetof(struct sccp_connection_request, variable_called); |
| 211 | 211 | |
| 212 | | struct sccp_connection_request *req = (struct sccp_connection_request *)msgb->data; |
| | 212 | struct sccp_connection_request *req = (struct sccp_connection_request *)msgb->l2h; |
| 213 | 213 | struct sccp_optional_data optional_data; |
| 214 | 214 | |
-
|
r13e10da
|
r5e6f52f
|
|
| 5 | 5 | |
| 6 | 6 | pkgconfigdir = $(libdir)/pkgconfig |
| 7 | | pkgconfig_DATA = openbsc.pc |
| | 7 | pkgconfig_DATA = openbsc.pc liblaf0rge1.pc libsccp.pc |
| 8 | 8 | |
| 9 | 9 | #dist-hook: |
-
|
rac96770
|
r5e6f52f
|
|
| 39 | 39 | AC_OUTPUT( |
| 40 | 40 | openbsc.pc |
| | 41 | liblaf0rge1.pc |
| | 42 | libsccp.pc |
| 41 | 43 | include/openbsc/Makefile |
| 42 | 44 | include/vty/Makefile |
-
|
rffa55a4
|
r1fdbf40
|
|
| 1 | | noinst_HEADERS = abis_nm.h abis_rsl.h debug.h db.h gsm_04_08.h gsm_data.h \ |
| 2 | | gsm_subscriber.h linuxlist.h msgb.h select.h tlv.h gsm_04_11.h \ |
| | 1 | noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \ |
| | 2 | gsm_subscriber.h gsm_04_11.h \ |
| 3 | 3 | timer.h misdn.h chan_alloc.h telnet_interface.h paging.h \ |
| 4 | | subchan_demux.h trau_frame.h e1_input.h trau_mux.h signal.h \ |
| | 4 | subchan_demux.h trau_frame.h e1_input.h trau_mux.h \ |
| 5 | 5 | gsm_utils.h ipaccess.h rs232.h openbscdefines.h rtp_proxy.h \ |
| 6 | | bsc_rll.h mncc.h talloc.h transaction.h ussd.h gsm_04_80.h \ |
| | 6 | bsc_rll.h mncc.h transaction.h ussd.h gsm_04_80.h \ |
| 7 | 7 | silent_call.h mgcp.h meas_rep.h bitvec.h rest_octets.h \ |
| 8 | 8 | system_information.h handover.h statistics.h |
| | 9 | |
| | 10 | laforge_HEADERS = signal.h linuxlist.h timer.h talloc.h msgb.h select.h tlv.h \ |
| | 11 | debug.h |
| | 12 | laforgedir= $(includedir)/laf0rge1 |
| | 13 | |
| | 14 | openbsc_HEADERS = gsm_04_08.h meas_rep.h |
| | 15 | openbscdir = $(includedir)/openbsc |
-
|
r0183edd
|
rd3d5be1
|
|
| 49 | 49 | struct msgb *ipaccess_read_msg(struct bsc_fd *bfd, int *error); |
| 50 | 50 | void ipaccess_prepend_header(struct msgb *msg, int proto); |
| | 51 | int ipaccess_send_id_ack(int fd); |
| | 52 | int ipaccess_send_id_req(int fd); |
| | 53 | |
| | 54 | int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len); |
| | 55 | |
| 51 | 56 | |
| 52 | 57 | /* |
-
|
rcbbd498
|
r6d89dac
|
|
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | | #include <openbsc/linuxlist.h> |
| | 23 | #include <sys/types.h> |
| | 24 | #include "linuxlist.h" |
| 24 | 25 | |
| 25 | 26 | struct bts_link; |
-
|
r13e10da
|
r245d17b
|
|
| 2 | 2 | #define _BSC_SELECT_H |
| 3 | 3 | |
| 4 | | #include <openbsc/linuxlist.h> |
| | 4 | #include "linuxlist.h" |
| 5 | 5 | |
| 6 | 6 | #define BSC_FD_READ 0x0001 |
-
|
rb61e3b2
|
rf5b36ca
|
|
| 28 | 28 | #include <vty/vty.h> |
| 29 | 29 | |
| 30 | | #define TELNET_COMMAND_48 1 |
| 31 | | #define TELNET_COMMAND_11 2 |
| 32 | | |
| 33 | 30 | struct telnet_connection { |
| 34 | 31 | struct llist_head entry; |
-
|
r50781488
|
r701d175
|
|
| 23 | 23 | #define TLV16_GROSS_LEN(x) ((2*x)+2) |
| 24 | 24 | #define TL16V_GROSS_LEN(x) (x+3) |
| | 25 | #define L16TV_GROSS_LEN(x) (x+3) |
| 25 | 26 | |
| 26 | 27 | #define TVLV_MAX_ONEBYTE 0x7f |
| … |
… |
|
| 104 | 105 | u_int8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len)); |
| 105 | 106 | return tvlv_put(buf, tag, len, val); |
| | 107 | } |
| | 108 | |
| | 109 | static inline u_int8_t *msgb_l16tv_put(struct msgb *msg, u_int16_t len, u_int8_t tag, |
| | 110 | const u_int8_t *val) |
| | 111 | { |
| | 112 | u_int8_t *buf = msgb_put(msg, L16TV_GROSS_LEN(len)); |
| | 113 | |
| | 114 | *buf++ = len >> 8; |
| | 115 | *buf++ = len & 0xff; |
| | 116 | *buf++ = tag; |
| | 117 | memcpy(buf, val, len); |
| | 118 | return buf + len; |
| 106 | 119 | } |
| 107 | 120 | |
-
|
rac96770
|
r5e6f52f
|
|
| 1 | | noinst_HEADERS = sccp_types.h sccp.h |
| | 1 | sccp_HEADERS = sccp_types.h sccp.h |
| | 2 | sccpdir = $(includedir)/sccp |
-
|
r82da7fc
|
r7184c2d
|
|
| 28 | 28 | |
| 29 | 29 | #include <sys/socket.h> |
| 30 | | |
| 31 | | #include <openbsc/msgb.h> |
| | 30 | #include <sys/types.h> |
| 32 | 31 | |
| 33 | 32 | #include "sccp_types.h" |
| 34 | 33 | |
| | 34 | struct msgb; |
| 35 | 35 | struct sccp_system; |
| 36 | 36 | |
-
|
r13e10da
|
r1fdbf40
|
|
| 2 | 2 | exec_prefix=@exec_prefix@ |
| 3 | 3 | libdir=@libdir@ |
| 4 | | includedir=@includedir@/openbsc-1.0 |
| | 4 | includedir=@includedir@/ |
| 5 | 5 | |
| 6 | 6 | Name: OpenBSC |
-
|
re095502
|
rc64d9f7
|
|
| 4 | 4 | sbin_PROGRAMS = bsc_hack bs11_config ipaccess-find ipaccess-config \ |
| 5 | 5 | isdnsync bsc_mgcp ipaccess-proxy |
| 6 | | noinst_LIBRARIES = libbsc.a libmsc.a libvty.a libsccp.a |
| | 6 | noinst_LIBRARIES = libbsc.a libmsc.a libvty.a |
| 7 | 7 | noinst_HEADERS = vty/cardshell.h |
| 8 | 8 | |
| | 9 | bscdir = $(libdir) |
| | 10 | bsc_LIBRARIES = liblaf0rge1.a libsccp.a |
| | 11 | |
| | 12 | liblaf0rge1_a_SOURCES = msgb.c timer.c talloc.c select.c signal.c debug.c |
| | 13 | |
| 9 | 14 | libbsc_a_SOURCES = abis_rsl.c abis_nm.c gsm_data.c gsm_04_08_utils.c \ |
| 10 | | msgb.c select.c chan_alloc.c timer.c debug.c \ |
| | 15 | chan_alloc.c \ |
| 11 | 16 | gsm_subscriber_base.c subchan_demux.c bsc_rll.c transaction.c \ |
| 12 | 17 | trau_frame.c trau_mux.c paging.c e1_config.c e1_input.c tlv_parser.c \ |
| 13 | | input/misdn.c input/ipaccess.c signal.c gsm_utils.c talloc.c \ |
| | 18 | input/misdn.c input/ipaccess.c signal.c gsm_utils.c \ |
| 14 | 19 | talloc_ctx.c system_information.c bitvec.c rest_octets.c \ |
| 15 | 20 | rtp_proxy.c statistics.c bts_siemens_bs11.c bts_ipaccess_nanobts.c \ |
| … |
… |
|
| 26 | 31 | |
| 27 | 32 | bsc_hack_SOURCES = bsc_hack.c bsc_init.c vty_interface.c vty_interface_layer3.c |
| 28 | | bsc_hack_LDADD = libmsc.a libbsc.a libmsc.a libvty.a -ldl -ldbi $(LIBCRYPT) |
| | 33 | bsc_hack_LDADD = libmsc.a libbsc.a libmsc.a libvty.a liblaf0rge1.a -ldl -ldbi $(LIBCRYPT) |
| 29 | 34 | |
| 30 | 35 | bs11_config_SOURCES = bs11_config.c abis_nm.c gsm_data.c msgb.c debug.c \ |
| … |
… |
|
| 35 | 40 | |
| 36 | 41 | ipaccess_config_SOURCES = ipaccess/ipaccess-config.c ipaccess/ipaccess-firmware.c |
| 37 | | ipaccess_config_LDADD = libbsc.a libmsc.a libbsc.a libvty.a -ldl -ldbi $(LIBCRYPT) |
| | 42 | ipaccess_config_LDADD = libbsc.a libmsc.a libbsc.a libvty.a liblaf0rge1.a -ldl -ldbi $(LIBCRYPT) |
| 38 | 43 | |
| 39 | 44 | isdnsync_SOURCES = isdnsync.c |
| 40 | 45 | |
| 41 | 46 | bsc_mgcp_SOURCES = mgcp/mgcp_main.c mgcp/mgcp_protocol.c msgb.c talloc.c debug.c select.c timer.c telnet_interface.c |
| 42 | | bsc_mgcp_LDADD = libvty.a |
| | 47 | bsc_mgcp_LDADD = libvty.a liblaf0rge1.a |
| 43 | 48 | |
| 44 | 49 | ipaccess_proxy_SOURCES = ipaccess/ipaccess-proxy.c msgb.c select.c talloc.c debug.c timer.c |
-
|
r7de6796
|
rfb0b6fc
|
|
| 803 | 803 | break; |
| 804 | 804 | case GSM_BAND_900: |
| 805 | | if (bts->c0->arfcn < 1 || bts->c0->arfcn > 124) { |
| 806 | | LOGP(DNM, LOGL_ERROR, "GSM900 channel must be between 1-124.\n"); |
| | 805 | if (bts->c0->arfcn < 1 || |
| | 806 | (bts->c0->arfcn > 124 && bts->c0->arfcn < 955) || |
| | 807 | bts->c0->arfcn > 1023) { |
| | 808 | LOGP(DNM, LOGL_ERROR, "GSM900 channel must be between 1-124, 955-1023.\n"); |
| 807 | 809 | return -EINVAL; |
| 808 | 810 | } |
-
|
r7971d3d
|
r4d2d95b
|
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | | static int ipac_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len) |
| | 92 | int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len) |
| 93 | 93 | { |
| 94 | 94 | u_int8_t t_len; |
| … |
… |
|
| 165 | 165 | } |
| 166 | 166 | |
| | 167 | /* send the id ack */ |
| | 168 | int ipaccess_send_id_ack(int fd) |
| | 169 | { |
| | 170 | return write(fd, id_ack, sizeof(id_ack)); |
| | 171 | } |
| | 172 | |
| | 173 | int ipaccess_send_id_req(int fd) |
| | 174 | { |
| | 175 | return write(fd, id_req, sizeof(id_req)); |
| | 176 | } |
| | 177 | |
| 167 | 178 | /* base handling of the ip.access protocol */ |
| 168 | 179 | int ipaccess_rcvmsg_base(struct msgb *msg, |
| … |
… |
|
| 181 | 192 | case IPAC_MSGT_ID_ACK: |
| 182 | 193 | DEBUGP(DMI, "ID_ACK? -> ACK!\n"); |
| 183 | | ret = write(bfd->fd, id_ack, sizeof(id_ack)); |
| | 194 | ret = ipaccess_send_id_ack(bfd->fd); |
| 184 | 195 | break; |
| 185 | 196 | } |
| … |
… |
|
| 202 | 213 | DEBUGP(DMI, "ID_RESP "); |
| 203 | 214 | /* parse tags, search for Unit ID */ |
| 204 | | ipac_idtag_parse(&tlvp, (u_int8_t *)msg->l2h + 2, |
| | 215 | ipaccess_idtag_parse(&tlvp, (u_int8_t *)msg->l2h + 2, |
| 205 | 216 | msgb_l2len(msg)-2); |
| 206 | 217 | DEBUGP(DMI, "\n"); |
| … |
… |
|
| 531 | 542 | |
| 532 | 543 | /* Request ID. FIXME: request LOCATION, HW/SW VErsion, Unit Name, Serno */ |
| 533 | | ret = write(bfd->fd, id_req, sizeof(id_req)); |
| | 544 | ret = ipaccess_send_id_req(bfd->fd); |
| 534 | 545 | |
| 535 | 546 | return ret; |
| … |
… |
|
| 588 | 599 | //bfd->data = line; |
| 589 | 600 | |
| | 601 | if (bfd->fd < 0) { |
| | 602 | LOGP(DINP, LOGL_ERROR, "could not create TCP socket.\n"); |
| | 603 | return -EIO; |
| | 604 | } |
| | 605 | |
| 590 | 606 | memset(&addr, 0, sizeof(addr)); |
| 591 | 607 | addr.sin_family = AF_INET; |
| … |
… |
|
| 599 | 615 | LOGP(DINP, LOGL_ERROR, "could not bind l2 socket %s\n", |
| 600 | 616 | strerror(errno)); |
| | 617 | close(bfd->fd); |
| 601 | 618 | return -EIO; |
| 602 | 619 | } |
| … |
… |
|
| 605 | 622 | if (ret < 0) { |
| 606 | 623 | perror("listen"); |
| | 624 | close(bfd->fd); |
| 607 | 625 | return ret; |
| 608 | 626 | } |
| … |
… |
|
| 611 | 629 | if (ret < 0) { |
| 612 | 630 | perror("register_listen_fd"); |
| | 631 | close(bfd->fd); |
| 613 | 632 | return ret; |
| 614 | 633 | } |
| … |
… |
|
| 629 | 648 | bfd->priv_nr = 1; |
| 630 | 649 | |
| | 650 | if (bfd->fd < 0) { |
| | 651 | LOGP(DINP, LOGL_ERROR, "could not create TCP socket.\n"); |
| | 652 | return -EIO; |
| | 653 | } |
| | 654 | |
| 631 | 655 | setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); |
| 632 | 656 | |
-
|
r93d4394
|
rb19dc28
|
|
| 5 | 5 | |
| 6 | 6 | db_test_SOURCES = db_test.c |
| 7 | | db_test_LDADD = $(top_builddir)/src/libbsc.a $(top_builddir)/src/libmsc.a $(top_builddir)/src/libbsc.a -ldl -ldbi |
| | 7 | db_test_LDADD = $(top_builddir)/src/libbsc.a $(top_builddir)/src/libmsc.a $(top_builddir)/src/libbsc.a $(top_builddir)/src/liblaf0rge1.a -ldl -ldbi |
| 8 | 8 | |
-
|
r1494a76
|
rb19dc28
|
|
| 3 | 3 | |
| 4 | 4 | gsm0408_test_SOURCES = gsm0408_test.c |
| 5 | | gsm0408_test_LDADD = $(top_builddir)/src/libbsc.a $(top_builddir)/src/libmsc.a $(top_builddir)/src/libbsc.a -ldbi |
| | 5 | gsm0408_test_LDADD = $(top_builddir)/src/libbsc.a $(top_builddir)/src/libmsc.a $(top_builddir)/src/libbsc.a $(top_builddir)/src/liblaf0rge1.a -ldbi |
-
|
rac96770
|
rb19dc28
|
|
| 5 | 5 | |
| 6 | 6 | sccp_test_SOURCES = sccp_test.c |
| 7 | | sccp_test_LDADD = $(top_builddir)/src/libsccp.a $(top_builddir)/src/libbsc.a |
| | 7 | sccp_test_LDADD = $(top_builddir)/src/libsccp.a $(top_builddir)/src/libbsc.a $(top_builddir)/src/liblaf0rge1.a |
| 8 | 8 | |
-
|
r6ae6572
|
r7184c2d
|
|
| 27 | 27 | #include <arpa/inet.h> |
| 28 | 28 | |
| 29 | | #include <sccp/sccp.h> |
| 30 | 29 | #include <openbsc/gsm_data.h> |
| 31 | 30 | #include <openbsc/debug.h> |
| | 31 | #include <openbsc/msgb.h> |
| | 32 | |
| | 33 | #include <sccp/sccp.h> |
| 32 | 34 | |
| 33 | 35 | #define MIN(x, y) ((x) < (y) ? (x) : (y)) |
-
|
r93d4394
|
rb19dc28
|
|
| 3 | 3 | |
| 4 | 4 | sms_test_SOURCES = sms_test.c |
| 5 | | sms_test_LDADD = $(top_builddir)/src/libmsc.a $(top_builddir)/src/libbsc.a -ldl -ldbi |
| | 5 | sms_test_LDADD = $(top_builddir)/src/libmsc.a $(top_builddir)/src/libbsc.a $(top_builddir)/src/liblaf0rge1.a -ldl -ldbi |