Changeset 65f991e in mainline
- Timestamp:
- 2013-07-25T12:32:44Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b323a3a
- Parents:
- c442f63
- Location:
- uspace/srv/net/ethip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/ethip/ethip.h
rc442f63 r65f991e 46 46 47 47 typedef struct { 48 link_t addr_list;48 link_t link; 49 49 inet_addr_t addr; 50 50 } ethip_link_addr_t; 51 51 52 52 typedef struct ethip_nic { 53 link_t nic_list;53 link_t link; 54 54 service_id_t svc_id; 55 55 char *svc_name; … … 61 61 /** MAC address */ 62 62 addr48_t mac_addr; 63 /** List of IP addresses configured on this link */ 64 list_t addr_list; /* of ethip_link_addr_t */ 63 64 /** 65 * List of IP addresses configured on this link 66 * (of the type ethip_link_addr_t) 67 */ 68 list_t addr_list; 65 69 } ethip_nic_t; 66 70 -
uspace/srv/net/ethip/ethip_nic.c
rc442f63 r65f991e 83 83 already_known = false; 84 84 85 list_foreach(ethip_nic_list, nic_link) {86 ethip_nic_t *nic = list_get_instance( nic_link,87 ethip_nic_t, nic_list);85 list_foreach(ethip_nic_list, link) { 86 ethip_nic_t *nic = list_get_instance(link, 87 ethip_nic_t, link); 88 88 if (nic->svc_id == svcs[i]) { 89 89 already_known = true; … … 115 115 } 116 116 117 link_initialize(&nic-> nic_list);117 link_initialize(&nic->link); 118 118 list_initialize(&nic->addr_list); 119 119 … … 130 130 } 131 131 132 link_initialize(&laddr-> addr_list);132 link_initialize(&laddr->link); 133 133 laddr->addr = *addr; 134 134 … … 180 180 181 181 log_msg(LOG_DEFAULT, LVL_DEBUG, "Opened NIC '%s'", nic->svc_name); 182 list_append(&nic-> nic_list, ðip_nic_list);182 list_append(&nic->link, ðip_nic_list); 183 183 in_list = true; 184 184 … … 209 209 error: 210 210 if (in_list) 211 list_remove(&nic->nic_list); 211 list_remove(&nic->link); 212 212 213 if (nic->sess != NULL) 213 214 async_hangup(nic->sess); 215 214 216 ethip_nic_delete(nic); 215 217 return rc; … … 312 314 list_foreach(ethip_nic_list, link) { 313 315 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_find_by_iplink_sid - element"); 314 ethip_nic_t *nic = list_get_instance(link, ethip_nic_t, 315 nic_list); 316 ethip_nic_t *nic = list_get_instance(link, ethip_nic_t, link); 316 317 317 318 if (nic->iplink_sid == iplink_sid) { … … 342 343 return ENOMEM; 343 344 344 list_append(&laddr-> addr_list, &nic->addr_list);345 list_append(&laddr->link, &nic->addr_list); 345 346 return EOK; 346 347 } … … 354 355 return ENOENT; 355 356 356 list_remove(&laddr-> addr_list);357 list_remove(&laddr->link); 357 358 ethip_link_addr_delete(laddr); 358 359 return EOK; … … 366 367 list_foreach(nic->addr_list, link) { 367 368 ethip_link_addr_t *laddr = list_get_instance(link, 368 ethip_link_addr_t, addr_list);369 ethip_link_addr_t, link); 369 370 370 371 if (inet_addr_compare(addr, &laddr->addr))
Note:
See TracChangeset
for help on using the changeset viewer.