aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-06-30 12:19:42 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2011-06-30 12:19:42 +0200
commitc9c4fd39055ab02c0af59d5519e62edc456e3d0b (patch)
treeb4ddf50a9b715a7a0270077e21790e8ec5efaf59 /include
parent59301856f6cf7e9c36b1494aa98b6b984b4b52d1 (diff)
major updates in e1_input callback ops and IPA infrastructures
This patch is a major update of the callback infrastructure, now the e1input_ops looks like the following: struct e1inp_sign_link * (*sign_link_up)(void *unit_info, struct e1inp_line *line, enum e1inp_sign_type type); void (*sign_link_down)(struct e1inp_line *line); int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); The sign_link_up and sign_link_down will be used by the A-bis over IP input drivers. The sign_link_up callback is used if we receive a ID_RESP message, in that case, we have to set up the sign link for the corresponding new OML/RSL signal link. The pointer to unit_info provides a data structure that contains the BTS device details if we run as BSC, and the requested device information from the BSC if we run as BTS. The sign_link_up callback must return the new sign_link created. The sign_link_down callback is invoked if the line does down, which means that the counterpart has closed the socket. The sign_link callback is used to handle all RSL/OML messages. I have also added the following callback to the e1inp_driver: + void (*close)(struct e1inp_ts *ts); Which is invoked if you call e1inp_sign_link_destroy(). This callback is used to close the socket that is linked to that timeslot. This is useful for A-bis over IP drivers since sockets are closed if the OML/RSL signalling link is destroyed. As you can notice, I have also added all the ID_RESP parsing into libosmo-abis for both ipaccess and hsl drivers. This patch also contains a rework of the ipa_client_link whose integration with the e1_input infrastructure was broken (the transmission path was broken). This patch also contains more develop examples that act as BSC and BTS for the ipaccess driver. Sorry, I know it would be better to split all these changes into logical pieces but many of them are tightly related. This is under heavy development stage, it's anyway hard to track changes until this becomes more stable.
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/abis/e1_input.h7
-rw-r--r--include/osmocom/abis/ipa.h9
-rw-r--r--include/osmocom/abis/ipaccess.h10
3 files changed, 20 insertions, 6 deletions
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index a9b6178..d2033ef 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -116,6 +116,7 @@ struct e1inp_driver {
const char *name;
int (*want_write)(struct e1inp_ts *ts);
int (*line_update)(struct e1inp_line *line, enum e1inp_line_role role, const char *addr);
+ void (*close)(struct e1inp_ts *ts);
int default_delay;
};
@@ -123,9 +124,9 @@ struct e1inp_line_ops {
enum e1inp_line_role role;
char *addr;
- int (*sign_link_up)(struct msgb *msg, struct e1inp_line *line, enum e1inp_sign_type type);
- int (*sign_link)(struct msgb *msg, struct e1inp_line *line, struct e1inp_sign_link *link);
- int (*error)(struct msgb *msg, struct e1inp_line *line, enum e1inp_sign_type type, int error);
+ struct e1inp_sign_link * (*sign_link_up)(void *unit_info, struct e1inp_line *line, enum e1inp_sign_type type);
+ void (*sign_link_down)(struct e1inp_line *line);
+ int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link);
};
struct e1inp_line {
diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h
index f088ec0..d455069 100644
--- a/include/osmocom/abis/ipa.h
+++ b/include/osmocom/abis/ipa.h
@@ -42,19 +42,22 @@ enum ipa_client_link_state {
struct ipa_client_link {
struct e1inp_line *line;
- struct osmo_fd ofd;
+ struct osmo_fd *ofd;
struct llist_head tx_queue;
struct osmo_timer_list timer;
enum ipa_client_link_state state;
const char *addr;
uint16_t port;
- int (*cb)(struct ipa_client_link *link, struct msgb *msg);
+ int (*read_cb)(struct ipa_client_link *link, struct msgb *msg);
+ int (*write_cb)(struct ipa_client_link *link);
void *data;
};
-struct ipa_client_link *ipa_client_link_create(void *ctx, struct e1inp_line *line, const char *addr, uint16_t port, int (*cb)(struct ipa_client_link *link, struct msgb *msgb), void *data);
+struct ipa_client_link *ipa_client_link_create(void *ctx, struct e1inp_ts *ts, const char *driver_name, int priv_nr, const char *addr, uint16_t port, int (*read_cb)(struct ipa_client_link *link, struct msgb *msgb), int (*write_cb)(struct ipa_client_link *link), void *data);
void ipa_client_link_destroy(struct ipa_client_link *link);
+int ipa_client_write_default_cb(struct ipa_client_link *link);
+
int ipa_client_link_open(struct ipa_client_link *link);
void ipa_client_link_close(struct ipa_client_link *link);
diff --git a/include/osmocom/abis/ipaccess.h b/include/osmocom/abis/ipaccess.h
index 2792572..d4174a8 100644
--- a/include/osmocom/abis/ipaccess.h
+++ b/include/osmocom/abis/ipaccess.h
@@ -90,4 +90,14 @@ struct sdp_header_entry {
uint32_t start;
} __attribute__((packed));
+struct ipaccess_unit {
+ uint16_t site_id;
+ uint16_t bts_id;
+ uint16_t trx_id;
+};
+
+struct hsl_unit {
+ unsigned long serno;
+};
+
#endif /* _OSMO_PROTO_IPACCESS_H */