Changeset b7fd2a0 in mainline for uspace/lib/c/generic/inet.c
- Timestamp:
- 2018-01-13T03:10:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet.c
r36f0738 rb7fd2a0 42 42 static uint8_t inet_protocol = 0; 43 43 44 static int inet_callback_create(void)44 static errno_t inet_callback_create(void) 45 45 { 46 46 async_exch_t *exch = async_exchange_begin(inet_sess); … … 50 50 51 51 port_id_t port; 52 int rc = async_create_callback_port(exch, INTERFACE_INET_CB, 0, 0,52 errno_t rc = async_create_callback_port(exch, INTERFACE_INET_CB, 0, 0, 53 53 inet_cb_conn, NULL, &port); 54 54 … … 58 58 return rc; 59 59 60 int retval;60 errno_t retval; 61 61 async_wait_for(req, &retval); 62 62 … … 64 64 } 65 65 66 static int inet_set_proto(uint8_t protocol)67 { 68 async_exch_t *exch = async_exchange_begin(inet_sess); 69 int rc = async_req_1_0(exch, INET_SET_PROTO, protocol);66 static errno_t inet_set_proto(uint8_t protocol) 67 { 68 async_exch_t *exch = async_exchange_begin(inet_sess); 69 errno_t rc = async_req_1_0(exch, INET_SET_PROTO, protocol); 70 70 async_exchange_end(exch); 71 71 … … 73 73 } 74 74 75 int inet_init(uint8_t protocol, inet_ev_ops_t *ev_ops)75 errno_t inet_init(uint8_t protocol, inet_ev_ops_t *ev_ops) 76 76 { 77 77 service_id_t inet_svc; 78 int rc;78 errno_t rc; 79 79 80 80 assert(inet_sess == NULL); … … 110 110 } 111 111 112 int inet_send(inet_dgram_t *dgram, uint8_t ttl, inet_df_t df)112 errno_t inet_send(inet_dgram_t *dgram, uint8_t ttl, inet_df_t df) 113 113 { 114 114 async_exch_t *exch = async_exchange_begin(inet_sess); … … 118 118 ttl, df, &answer); 119 119 120 int rc = async_data_write_start(exch, &dgram->src, sizeof(inet_addr_t));120 errno_t rc = async_data_write_start(exch, &dgram->src, sizeof(inet_addr_t)); 121 121 if (rc != EOK) { 122 122 async_exchange_end(exch); … … 141 141 } 142 142 143 int retval;143 errno_t retval; 144 144 async_wait_for(req, &retval); 145 145 … … 147 147 } 148 148 149 int inet_get_srcaddr(inet_addr_t *remote, uint8_t tos, inet_addr_t *local)149 errno_t inet_get_srcaddr(inet_addr_t *remote, uint8_t tos, inet_addr_t *local) 150 150 { 151 151 async_exch_t *exch = async_exchange_begin(inet_sess); … … 154 154 aid_t req = async_send_1(exch, INET_GET_SRCADDR, tos, &answer); 155 155 156 int rc = async_data_write_start(exch, remote, sizeof(inet_addr_t));156 errno_t rc = async_data_write_start(exch, remote, sizeof(inet_addr_t)); 157 157 if (rc != EOK) { 158 158 async_exchange_end(exch); … … 170 170 } 171 171 172 int retval;172 errno_t retval; 173 173 async_wait_for(req, &retval); 174 174 … … 197 197 } 198 198 199 int rc = async_data_write_finalize(callid, &dgram.src, size);199 errno_t rc = async_data_write_finalize(callid, &dgram.src, size); 200 200 if (rc != EOK) { 201 201 async_answer_0(callid, rc);
Note:
See TracChangeset
for help on using the changeset viewer.