diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2011-06-25 18:42:55 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-06-25 18:42:55 +0200 |
commit | f163d23bf66b76037645f5a1bdc3333cc88f1ad1 (patch) | |
tree | 4bb82692a80077fd712038a470f498986acd2930 /tests/e1inp_ipa_bsc_test.c | |
parent | 130c4fbe2e815d94bcf4b6d13849bebbfbf0198d (diff) |
e1_input: minor API changes to adapt it to openbsc
While working on the openbsc over libosmo-abis port, I noticed
several API changes that we need to perform for better adaptation.
Diffstat (limited to 'tests/e1inp_ipa_bsc_test.c')
-rw-r--r-- | tests/e1inp_ipa_bsc_test.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/e1inp_ipa_bsc_test.c b/tests/e1inp_ipa_bsc_test.c index 3dfbc54..64623b2 100644 --- a/tests/e1inp_ipa_bsc_test.c +++ b/tests/e1inp_ipa_bsc_test.c @@ -7,19 +7,22 @@ static void *tall_test; -static int sign_link_up(struct msgb *msg, struct e1inp_line *line) +static int sign_link_up(struct msgb *msg, struct e1inp_line *line, + enum e1inp_sign_type type) { printf("ID_RESP received, create sign link.\n"); return 0; } -static int sign_link(struct msgb *msg, struct e1inp_sign_link *link) +static int sign_link(struct msgb *msg, struct e1inp_line *line, + struct e1inp_sign_link *link) { printf("OML/RSL data received\n"); return 0; } -static int error(struct msgb *msg, int error) +static int error(struct msgb *msg, struct e1inp_line *line, + enum e1inp_sign_type type, int error) { printf("error, malformed message\n"); return 0; @@ -52,6 +55,8 @@ int main(void) osmo_init_logging(&bsc_test_log_info); struct e1inp_line_ops ops = { + .addr = "0.0.0.0", + .role = E1INP_LINE_R_BSC, .sign_link_up = sign_link_up, .sign_link = sign_link, .error = error, @@ -59,12 +64,14 @@ int main(void) #define LINENR 0 - line = e1inp_line_create(LINENR, "ipa", &ops); + line = e1inp_line_create(LINENR, "ipa"); if (line == NULL) { LOGP(DBSCTEST, LOGL_ERROR, "problem creating E1 line\n"); exit(EXIT_FAILURE); } + e1inp_line_bind_ops(line, &ops); + /* * Depending if this is a real or virtual E1 lines: * - real (ISDN): create signal link for OML and RSL before line up. @@ -76,7 +83,7 @@ int main(void) * it explains how this is done with ISDN. */ - if (e1inp_line_update(line, E1INP_LINE_R_BSC, "0.0.0.0") < 0) { + if (e1inp_line_update(line) < 0) { LOGP(DBSCTEST, LOGL_ERROR, "problem creating E1 line\n"); exit(EXIT_FAILURE); } |