Changeset 4e5c7ba in mainline for uspace/srv/net/il
- Timestamp:
- 2010-11-18T22:36:12Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f772bc55
- Parents:
- cb569e6
- Location:
- uspace/srv/net/il
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
rcb569e6 r4e5c7ba 83 83 * @param[in] device The device specific data. 84 84 */ 85 static void arp_clear_device(arp_device_ refdevice)85 static void arp_clear_device(arp_device_t *device) 86 86 { 87 87 int count; 88 arp_proto_ refproto;88 arp_proto_t *proto; 89 89 90 90 for (count = arp_protos_count(&device->protos) - 1; count >= 0; … … 105 105 { 106 106 int count; 107 arp_device_ refdevice;107 arp_device_t *device; 108 108 109 109 fibril_rwlock_write_lock(&arp_globals.lock); … … 128 128 services_t protocol, measured_string_ref address) 129 129 { 130 arp_device_ refdevice;131 arp_proto_ refproto;130 arp_device_t *device; 131 arp_proto_t *proto; 132 132 133 133 fibril_rwlock_write_lock(&arp_globals.lock); … … 150 150 static int arp_clear_device_req(int arp_phone, device_id_t device_id) 151 151 { 152 arp_device_ refdevice;152 arp_device_t *device; 153 153 154 154 fibril_rwlock_write_lock(&arp_globals.lock); … … 174 174 * @returns ENOMEM if there is not enough memory left. 175 175 */ 176 static int arp_proto_create(arp_proto_ ref*proto, services_t service,176 static int arp_proto_create(arp_proto_t **proto, services_t service, 177 177 measured_string_ref address) 178 178 { 179 179 int rc; 180 180 181 *proto = (arp_proto_ ref) malloc(sizeof(arp_proto_t));181 *proto = (arp_proto_t *) malloc(sizeof(arp_proto_t)); 182 182 if (!*proto) 183 183 return ENOMEM; … … 215 215 services_t protocol, measured_string_ref address) 216 216 { 217 arp_device_ refdevice;218 arp_proto_ refproto;217 arp_device_t *device; 218 arp_proto_t *proto; 219 219 hw_type_t hardware; 220 220 int index; … … 260 260 261 261 /* Create a new device */ 262 device = (arp_device_ ref) malloc(sizeof(arp_device_t));262 device = (arp_device_t *) malloc(sizeof(arp_device_t)); 263 263 if (!device) { 264 264 fibril_rwlock_write_unlock(&arp_globals.lock); … … 381 381 static int arp_mtu_changed_message(device_id_t device_id, size_t mtu) 382 382 { 383 arp_device_ refdevice;383 arp_device_t *device; 384 384 385 385 fibril_rwlock_write_lock(&arp_globals.lock); … … 418 418 { 419 419 size_t length; 420 arp_header_ refheader;421 arp_device_ refdevice;422 arp_proto_ refproto;420 arp_header_t *header; 421 arp_device_t *device; 422 arp_proto_t *proto; 423 423 measured_string_ref hw_source; 424 424 uint8_t *src_hw; … … 436 436 return ENOENT; 437 437 438 header = (arp_header_ ref) packet_get_data(packet);438 header = (arp_header_t *) packet_get_data(packet); 439 439 if ((ntohs(header->hardware) != device->hardware) || 440 440 (length < sizeof(arp_header_t) + header->hardware_length * 2U + … … 527 527 measured_string_ref target) 528 528 { 529 arp_device_ refdevice;530 arp_proto_ refproto;529 arp_device_t *device; 530 arp_proto_t *proto; 531 531 measured_string_ref addr; 532 532 size_t length; 533 533 packet_t packet; 534 arp_header_ refheader;534 arp_header_t *header; 535 535 536 536 if (!target) … … 561 561 return NULL; 562 562 563 header = (arp_header_ ref) packet_suffix(packet, length);563 header = (arp_header_t *) packet_suffix(packet, length); 564 564 if (!header) { 565 565 pq_release_remote(arp_globals.net_phone, packet_get_id(packet)); -
uspace/srv/net/il/arp/arp.h
rcb569e6 r4e5c7ba 55 55 typedef struct arp_device arp_device_t; 56 56 57 /** Type definition of the ARP device specific data pointer.58 * @see arp_device59 */60 typedef arp_device_t *arp_device_ref;61 62 57 /** Type definition of the ARP global data. 63 58 * @see arp_globals … … 69 64 */ 70 65 typedef struct arp_proto arp_proto_t; 71 72 /** Type definition of the ARP protocol specific data pointer.73 * @see arp_proto74 */75 typedef arp_proto_t *arp_proto_ref;76 66 77 67 /** ARP address map. -
uspace/srv/net/il/arp/arp_header.h
rcb569e6 r4e5c7ba 46 46 typedef struct arp_header arp_header_t; 47 47 48 /** Type definition of an ARP protocol header pointer.49 * @see arp_header50 */51 typedef arp_header_t *arp_header_ref;52 53 48 /** ARP protocol header. */ 54 49 struct arp_header { -
uspace/srv/net/il/ip/ip.c
rcb569e6 r4e5c7ba 144 144 static int ip_get_icmp_phone(void) 145 145 { 146 ip_proto_ refproto;146 ip_proto_t *proto; 147 147 int phone; 148 148 … … 308 308 * nil_packet_size_req() function. 309 309 */ 310 static int ip_netif_initialize(ip_netif_ refip_netif)310 static int ip_netif_initialize(ip_netif_t *ip_netif) 311 311 { 312 312 measured_string_t names[] = { … … 348 348 char *data; 349 349 measured_string_t address; 350 ip_route_ refroute;350 ip_route_t *route; 351 351 in_addr_t gateway; 352 352 int index; … … 378 378 return ENOTSUP; 379 379 } else if (ip_netif->ipv == IPV4) { 380 route = (ip_route_ ref) malloc(sizeof(ip_route_t));380 route = (ip_route_t *) malloc(sizeof(ip_route_t)); 381 381 if (!route) { 382 382 net_free_settings(configuration, data); … … 491 491 static int ip_mtu_changed_message(device_id_t device_id, size_t mtu) 492 492 { 493 ip_netif_ refnetif;493 ip_netif_t *netif; 494 494 495 495 fibril_rwlock_write_lock(&ip_globals.netifs_lock); … … 516 516 static int ip_device_state_message(device_id_t device_id, device_state_t state) 517 517 { 518 ip_netif_ refnetif;518 ip_netif_t *netif; 519 519 520 520 fibril_rwlock_write_lock(&ip_globals.netifs_lock); … … 993 993 */ 994 994 static int 995 ip_send_route(packet_t packet, ip_netif_ ref netif, ip_route_refroute,995 ip_send_route(packet_t packet, ip_netif_t *netif, ip_route_t *route, 996 996 in_addr_t *src, in_addr_t dest, services_t error) 997 997 { … … 1065 1065 * @returns NULL if no route was found. 1066 1066 */ 1067 static ip_route_ ref1068 ip_netif_find_route(ip_netif_refnetif, in_addr_t destination)1067 static ip_route_t 1068 *ip_netif_find_route(ip_netif_t *netif, in_addr_t destination) 1069 1069 { 1070 1070 int index; 1071 ip_route_ refroute;1071 ip_route_t *route; 1072 1072 1073 1073 if (!netif) … … 1093 1093 * @returns NULL if no route was found. 1094 1094 */ 1095 static ip_route_ refip_find_route(in_addr_t destination) {1095 static ip_route_t *ip_find_route(in_addr_t destination) { 1096 1096 int index; 1097 ip_route_ refroute;1098 ip_netif_ refnetif;1097 ip_route_t *route; 1098 ip_netif_t *netif; 1099 1099 1100 1100 // start with the last netif - the newest one … … 1119 1119 * @returns NULL if no IP address was found. 1120 1120 */ 1121 static in_addr_t *ip_netif_address(ip_netif_ refnetif)1122 { 1123 ip_route_ refroute;1121 static in_addr_t *ip_netif_address(ip_netif_t *netif) 1122 { 1123 ip_route_t *route; 1124 1124 1125 1125 route = ip_routes_get_index(&netif->routes, 0); … … 1147 1147 tl_received_msg_t received_msg) 1148 1148 { 1149 ip_proto_ refproto;1149 ip_proto_t *proto; 1150 1150 int index; 1151 1151 … … 1153 1153 return EINVAL; 1154 1154 1155 proto = (ip_proto_ ref) malloc(sizeof(ip_protos_t));1155 proto = (ip_proto_t *) malloc(sizeof(ip_protos_t)); 1156 1156 if (!proto) 1157 1157 return ENOMEM; … … 1180 1180 ip_device_req_local(int il_phone, device_id_t device_id, services_t netif) 1181 1181 { 1182 ip_netif_ refip_netif;1183 ip_route_ refroute;1182 ip_netif_t *ip_netif; 1183 ip_route_t *route; 1184 1184 int index; 1185 1185 int rc; 1186 1186 1187 ip_netif = (ip_netif_ ref) malloc(sizeof(ip_netif_t));1187 ip_netif = (ip_netif_t *) malloc(sizeof(ip_netif_t)); 1188 1188 if (!ip_netif) 1189 1189 return ENOMEM; … … 1251 1251 { 1252 1252 int addrlen; 1253 ip_netif_ refnetif;1254 ip_route_ refroute;1253 ip_netif_t *netif; 1254 ip_route_t *route; 1255 1255 struct sockaddr *addr; 1256 1256 struct sockaddr_in *address_in; … … 1367 1367 size_t *content, size_t *suffix) 1368 1368 { 1369 ip_netif_ refnetif;1369 ip_netif_t *netif; 1370 1370 int index; 1371 1371 … … 1454 1454 services_t error) 1455 1455 { 1456 ip_proto_ refproto;1456 ip_proto_t *proto; 1457 1457 int phone; 1458 1458 services_t service; … … 1557 1557 ip_header_ref header; 1558 1558 in_addr_t dest; 1559 ip_route_ refroute;1559 ip_route_t *route; 1560 1560 int phone; 1561 1561 struct sockaddr *addr; … … 1647 1647 in_addr_t netmask, in_addr_t gateway) 1648 1648 { 1649 ip_route_ refroute;1650 ip_netif_ refnetif;1649 ip_route_t *route; 1650 ip_netif_t *netif; 1651 1651 int index; 1652 1652 … … 1659 1659 } 1660 1660 1661 route = (ip_route_ ref) malloc(sizeof(ip_route_t));1661 route = (ip_route_t *) malloc(sizeof(ip_route_t)); 1662 1662 if (!route) { 1663 1663 fibril_rwlock_write_unlock(&ip_globals.netifs_lock); … … 1681 1681 ip_set_gateway_req_local(int ip_phone, device_id_t device_id, in_addr_t gateway) 1682 1682 { 1683 ip_netif_ refnetif;1683 ip_netif_t *netif; 1684 1684 1685 1685 fibril_rwlock_write_lock(&ip_globals.netifs_lock); … … 1721 1721 icmp_type_t type; 1722 1722 icmp_code_t code; 1723 ip_netif_ refnetif;1723 ip_netif_t *netif; 1724 1724 measured_string_t address; 1725 ip_route_ refroute;1725 ip_route_t *route; 1726 1726 ip_header_ref header; 1727 1727 … … 1782 1782 in_addr_t *dest; 1783 1783 in_addr_t *src; 1784 ip_route_ refroute;1784 ip_route_t *route; 1785 1785 ipv4_pseudo_header_ref header_in; 1786 1786 -
uspace/srv/net/il/ip/ip.h
rcb569e6 r4e5c7ba 59 59 typedef struct ip_netif ip_netif_t; 60 60 61 /** Type definition of the IP network interface specific data pointer.62 * @see ip_netif63 */64 typedef ip_netif_t *ip_netif_ref;65 66 61 /** Type definition of the IP protocol specific data. 67 62 * @see ip_proto … … 69 64 typedef struct ip_proto ip_proto_t; 70 65 71 /** Type definition of the IP protocol specific data pointer.72 * @see ip_proto73 */74 typedef ip_proto_t *ip_proto_ref;75 76 66 /** Type definition of the IP route specific data. 77 67 * @see ip_route 78 68 */ 79 69 typedef struct ip_route ip_route_t; 80 81 /** Type definition of the IP route specific data pointer.82 * @see ip_route83 */84 typedef ip_route_t *ip_route_ref;85 70 86 71 /** IP network interfaces. … … 146 131 in_addr_t gateway; 147 132 /** Parent netif. */ 148 ip_netif_ refnetif;133 ip_netif_t *netif; 149 134 /** Target network mask. */ 150 135 in_addr_t netmask;
Note:
See TracChangeset
for help on using the changeset viewer.
