Changeset b4edc96 in mainline for uspace/srv/net/inetsrv
- Timestamp:
- 2021-08-08T09:20:20Z (4 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3e6bca8
- Parents:
- d5ed54b
- Location:
- uspace/srv/net/inetsrv
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/addrobj.c
rd5ed54b rb4edc96 38 38 #include <errno.h> 39 39 #include <fibril_synch.h> 40 #include <inet/eth_addr.h> 40 41 #include <io/log.h> 41 42 #include <ipc/loc.h> … … 229 230 230 231 errno_t rc; 231 addr48_t ldest_mac;232 eth_addr_t ldest_mac; 232 233 233 234 switch (ldest_ver) { -
uspace/srv/net/inetsrv/inet_link.c
rd5ed54b rb4edc96 35 35 */ 36 36 37 #include <stdbool.h>38 37 #include <errno.h> 39 #include <str_error.h>40 38 #include <fibril_synch.h> 39 #include <inet/eth_addr.h> 41 40 #include <inet/iplink.h> 42 41 #include <io/log.h> 43 42 #include <loc.h> 43 #include <stdbool.h> 44 44 #include <stdlib.h> 45 45 #include <str.h> 46 #include <str_error.h> 46 47 #include "addrobj.h" 47 48 #include "inetsrv.h" … … 56 57 57 58 static errno_t inet_iplink_recv(iplink_t *, iplink_recv_sdu_t *, ip_ver_t); 58 static errno_t inet_iplink_change_addr(iplink_t *, addr48_t *);59 static errno_t inet_iplink_change_addr(iplink_t *, eth_addr_t *); 59 60 static inet_link_t *inet_link_get_by_id_locked(sysarg_t); 60 61 … … 70 71 { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xfe, 0, 0, 0 }; 71 72 72 static void inet_link_local_node_ip( addr48_t *mac_addr,73 static void inet_link_local_node_ip(eth_addr_t *mac_addr, 73 74 addr128_t ip_addr) 74 75 { … … 121 122 } 122 123 123 static errno_t inet_iplink_change_addr(iplink_t *iplink, addr48_t *mac)124 static errno_t inet_iplink_change_addr(iplink_t *iplink, eth_addr_t *mac) 124 125 { 125 126 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_iplink_change_addr(): " … … 129 130 list_foreach(inet_links, link_list, inet_link_t, ilink) { 130 131 if (ilink->sess == iplink->sess) 131 memcpy(&ilink->mac, mac, sizeof(addr48_t));132 ilink->mac = *mac; 132 133 } 133 134 … … 387 388 * 388 389 */ 389 errno_t inet_link_send_dgram6(inet_link_t *ilink, addr48_t *ldest,390 errno_t inet_link_send_dgram6(inet_link_t *ilink, eth_addr_t *ldest, 390 391 inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, int df) 391 392 { -
uspace/srv/net/inetsrv/inet_link.h
rd5ed54b rb4edc96 38 38 #define INET_LINK_H_ 39 39 40 #include <inet/eth_addr.h> 40 41 #include <stddef.h> 41 42 #include <stdint.h> … … 45 46 extern errno_t inet_link_send_dgram(inet_link_t *, addr32_t, 46 47 addr32_t, inet_dgram_t *, uint8_t, uint8_t, int); 47 extern errno_t inet_link_send_dgram6(inet_link_t *, addr48_t *, inet_dgram_t *,48 extern errno_t inet_link_send_dgram6(inet_link_t *, eth_addr_t *, inet_dgram_t *, 48 49 uint8_t, uint8_t, int); 49 50 extern inet_link_t *inet_link_get_by_id(sysarg_t); -
uspace/srv/net/inetsrv/inetsrv.h
rd5ed54b rb4edc96 1 1 /* 2 * Copyright (c) 20 12Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 41 41 #include <stdbool.h> 42 42 #include <inet/addr.h> 43 #include <inet/eth_addr.h> 43 44 #include <inet/iplink.h> 44 45 #include <ipc/loc.h> … … 109 110 iplink_t *iplink; 110 111 size_t def_mtu; 111 addr48_t mac;112 eth_addr_t mac; 112 113 bool mac_valid; 113 114 } inet_link_t; -
uspace/srv/net/inetsrv/ndp.c
rd5ed54b rb4edc96 1 1 /* 2 * Copyright (c) 2021 Jiri Svoboda 2 3 * Copyright (c) 2013 Antonin Steinhauser 3 4 * All rights reserved. … … 36 37 37 38 #include <errno.h> 39 #include <inet/eth_addr.h> 40 #include <io/log.h> 38 41 #include <mem.h> 39 42 #include <stdlib.h> 40 #include <io/log.h>41 43 #include "ntrans.h" 42 44 #include "addrobj.h" … … 151 153 * 152 154 */ 153 errno_t ndp_translate(addr128_t src_addr, addr128_t ip_addr, addr48_t *mac_addr,155 errno_t ndp_translate(addr128_t src_addr, addr128_t ip_addr, eth_addr_t *mac_addr, 154 156 inet_link_t *ilink) 155 157 { … … 170 172 addr128(src_addr, packet.sender_proto_addr); 171 173 addr128(ip_addr, packet.solicited_ip); 172 addr48_solicited_node(ip_addr, &packet.target_hw_addr);174 eth_addr_solicited_node(ip_addr, &packet.target_hw_addr); 173 175 ndp_solicited_node_ip(ip_addr, packet.target_proto_addr); 174 176 -
uspace/srv/net/inetsrv/ndp.h
rd5ed54b rb4edc96 1 1 /* 2 * Copyright (c) 2021 Jiri Svoboda 2 3 * Copyright (c) 2013 Antonin Steinhauser 3 4 * All rights reserved. … … 39 40 40 41 #include <inet/addr.h> 42 #include <inet/eth_addr.h> 41 43 #include "inetsrv.h" 42 44 #include "icmpv6_std.h" … … 52 54 ndp_opcode_t opcode; 53 55 /** Sender hardware address */ 54 addr48_t sender_hw_addr;56 eth_addr_t sender_hw_addr; 55 57 /** Sender protocol address */ 56 58 addr128_t sender_proto_addr; 57 59 /** Target hardware address */ 58 addr48_t target_hw_addr;60 eth_addr_t target_hw_addr; 59 61 /** Target protocol address */ 60 62 addr128_t target_proto_addr; … … 64 66 65 67 extern errno_t ndp_received(inet_dgram_t *); 66 extern errno_t ndp_translate(addr128_t, addr128_t, addr48_t *, inet_link_t *);68 extern errno_t ndp_translate(addr128_t, addr128_t, eth_addr_t *, inet_link_t *); 67 69 68 70 #endif -
uspace/srv/net/inetsrv/ntrans.c
rd5ed54b rb4edc96 1 1 /* 2 * Copyright (c) 2021 Jiri Svoboda 2 3 * Copyright (c) 2013 Antonin Steinhauser 3 4 * All rights reserved. … … 38 39 #include <errno.h> 39 40 #include <fibril_synch.h> 41 #include <inet/eth_addr.h> 40 42 #include <inet/iplink_srv.h> 41 43 #include <stdlib.h> … … 73 75 * 74 76 */ 75 errno_t ntrans_add(addr128_t ip_addr, addr48_t *mac_addr)77 errno_t ntrans_add(addr128_t ip_addr, eth_addr_t *mac_addr) 76 78 { 77 79 inet_ntrans_t *ntrans; … … 134 136 * 135 137 */ 136 errno_t ntrans_lookup(addr128_t ip_addr, addr48_t *mac_addr)138 errno_t ntrans_lookup(addr128_t ip_addr, eth_addr_t *mac_addr) 137 139 { 138 140 fibril_mutex_lock(&ntrans_list_lock); -
uspace/srv/net/inetsrv/ntrans.h
rd5ed54b rb4edc96 1 1 /* 2 * Copyright (c) 2021 Jiri Svoboda 2 3 * Copyright (c) 2013 Antonin Steinhauser 3 4 * All rights reserved. … … 38 39 #define NTRANS_H_ 39 40 41 #include <inet/addr.h> 42 #include <inet/eth_addr.h> 40 43 #include <inet/iplink_srv.h> 41 #include <inet/addr.h>42 44 43 45 /** Address translation table element */ … … 45 47 link_t ntrans_list; 46 48 addr128_t ip_addr; 47 addr48_t mac_addr;49 eth_addr_t mac_addr; 48 50 } inet_ntrans_t; 49 51 50 extern errno_t ntrans_add(addr128_t, addr48_t *);52 extern errno_t ntrans_add(addr128_t, eth_addr_t *); 51 53 extern errno_t ntrans_remove(addr128_t); 52 extern errno_t ntrans_lookup(addr128_t, addr48_t *);54 extern errno_t ntrans_lookup(addr128_t, eth_addr_t *); 53 55 extern errno_t ntrans_wait_timeout(usec_t); 54 56 -
uspace/srv/net/inetsrv/pdu.c
rd5ed54b rb4edc96 505 505 506 506 message->length = 1; 507 mac48_encode(&ndp->sender_hw_addr, message->mac);507 eth_addr_encode(&ndp->sender_hw_addr, message->mac); 508 508 509 509 icmpv6_phdr_t phdr; … … 553 553 554 554 addr128_t_be2host(message->target_address, ndp->target_proto_addr); 555 mac48_decode(message->mac, &ndp->sender_hw_addr);555 eth_addr_decode(message->mac, &ndp->sender_hw_addr); 556 556 557 557 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.