6 struct mbim_message_header
{
9 uint32_t transaction_id
;
10 } __attribute__((packed
));
12 struct mbim_open_message
{
13 struct mbim_message_header header
;
14 uint32_t max_control_transfer
;
15 } __attribute__((packed
));
17 struct mbim_open_done_message
{
18 struct mbim_message_header header
;
20 } __attribute__((packed
));
22 struct mbim_close_done_message
{
24 } __attribute__((packed
));
26 struct mbim_error_message
{
27 uint32_t error_status_code
;
28 } __attribute__((packed
));
30 struct mbim_fragment_header
{
33 } __attribute__((packed
));
35 struct fragment_message
{
36 struct mbim_fragment_header fragment_header
;
38 } __attribute__((packed
));
40 struct command_message
{
41 struct mbim_message_header header
;
42 struct mbim_fragment_header fragment_header
;
43 uint8_t service_id
[16];
45 uint32_t command_type
;
46 uint32_t buffer_length
;
48 } __attribute__((packed
));
50 struct command_done_message
{
51 struct mbim_fragment_header fragment_header
;
52 uint8_t service_id
[16];
55 uint32_t buffer_length
;
57 } __attribute__((packed
));
59 struct indicate_status_message
{
60 struct mbim_fragment_header fragment_header
;
61 uint8_t service_id
[16];
63 uint32_t buffer_length
;
65 } __attribute__((packed
));
67 typedef int (*_mbim_cmd_request
)(void);
68 typedef int (*_mbim_cmd_response
)(void *buffer
, int len
);
70 extern uint8_t basic_connect
[16];
71 extern int transaction_id
;
73 const char* mbim_enum_string(struct mbim_enum
*e
, uint32_t key
);
74 char* mbim_get_string(struct mbim_string
*str
, char *in
);
75 void mbim_setup_header(struct mbim_message_header
*hdr
, MbimMessageType type
, int length
);
76 uint8_t* mbim_setup_command_msg(uint8_t *uuid
, uint32_t type
, uint32_t command_id
, int len
);
77 int mbim_send_open_msg(void);
78 int mbim_send_close_msg(void);
79 int mbim_send_command_msg(void);
80 int mbim_add_payload(uint8_t len
);
81 int mbim_encode_string(struct mbim_string
*str
, char *in
);
82 void mbim_get_ipv4(void *buffer
, char *out
, uint32_t offset
);