Changeset c62a8275 in mainline for uspace/srv
- Timestamp:
- 2014-09-01T11:17:23Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a4666a9
- Parents:
- f93ba6d5 (diff), 320bd52 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/srv/net
- Files:
-
- 3 edited
-
ethip/ethip.c (modified) (3 diffs)
-
ethip/ethip_nic.c (modified) (2 diffs)
-
inetsrv/inet_link.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/ethip/ethip.c
rf93ba6d5 rc62a8275 59 59 static int ethip_get_mtu(iplink_srv_t *srv, size_t *mtu); 60 60 static int ethip_get_mac48(iplink_srv_t *srv, addr48_t *mac); 61 static int ethip_set_mac48(iplink_srv_t *srv, addr48_t *mac); 61 62 static int ethip_addr_add(iplink_srv_t *srv, inet_addr_t *addr); 62 63 static int ethip_addr_remove(iplink_srv_t *srv, inet_addr_t *addr); … … 71 72 .get_mtu = ethip_get_mtu, 72 73 .get_mac48 = ethip_get_mac48, 74 .set_mac48 = ethip_set_mac48, 73 75 .addr_add = ethip_addr_add, 74 76 .addr_remove = ethip_addr_remove … … 284 286 } 285 287 288 static int ethip_set_mac48(iplink_srv_t *srv, addr48_t *mac) 289 { 290 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_set_mac48()"); 291 292 ethip_nic_t *nic = (ethip_nic_t *) srv->arg; 293 addr48(*mac, nic->mac_addr); 294 295 return EOK; 296 } 297 286 298 static int ethip_addr_add(iplink_srv_t *srv, inet_addr_t *addr) 287 299 { -
uspace/srv/net/ethip/ethip_nic.c
rf93ba6d5 rc62a8275 245 245 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 246 246 247 memcpy(&nic->mac_addr, addr, sizeof(nic->mac_addr)); 248 249 rc = iplink_ev_change_addr(&nic->iplink, &nic->mac_addr); 250 if (rc != EOK) { 251 log_msg(LOG_DEFAULT, LVL_DEBUG, "iplink_ev_change_addr() failed"); 252 return; 253 } 254 247 255 free(addr); 248 256 async_answer_0(callid, EOK); … … 309 317 break; 310 318 default: 311 log_msg(LOG_DEFAULT, LVL_DEBUG, "unknown IPC method: % d", (int)IPC_GET_IMETHOD(call));319 log_msg(LOG_DEFAULT, LVL_DEBUG, "unknown IPC method: %" PRIun, IPC_GET_IMETHOD(call)); 312 320 async_answer_0(callid, ENOTSUP); 313 321 } -
uspace/srv/net/inetsrv/inet_link.c
rf93ba6d5 rc62a8275 55 55 56 56 static int inet_iplink_recv(iplink_t *, iplink_recv_sdu_t *, ip_ver_t); 57 static int inet_iplink_change_addr(iplink_t *, addr48_t); 57 58 static inet_link_t *inet_link_get_by_id_locked(sysarg_t); 58 59 59 60 static iplink_ev_ops_t inet_iplink_ev_ops = { 60 .recv = inet_iplink_recv 61 .recv = inet_iplink_recv, 62 .change_addr = inet_iplink_change_addr, 61 63 }; 62 64 … … 110 112 111 113 return rc; 114 } 115 116 static int inet_iplink_change_addr(iplink_t *iplink, addr48_t mac) 117 { 118 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_iplink_change_addr(): " 119 "new addr=%02x:%02x:%02x:%02x:%02x:%02x", 120 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 121 122 list_foreach(inet_links, link_list, inet_link_t, ilink) { 123 if (ilink->sess == iplink->sess) 124 memcpy(&ilink->mac, mac, sizeof(addr48_t)); 125 } 126 127 return EOK; 112 128 } 113 129
Note:
See TracChangeset
for help on using the changeset viewer.
