Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a9c6b966 in mainline for uspace/srv/net/il/ip/ip.c


Ignore:
Timestamp:
2010-11-19T22:04:12Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
0b4a67a, fdbc3ff
Parents:
a7811f17 (diff), 1bfd3d3 (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.
Message:

Merge netstart removal and doxytag cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/ip/ip.c

    ra7811f17 ra9c6b966  
    139139 * Searches the registered protocols.
    140140 *
    141  * @returns             The found ICMP phone.
    142  * @returns             ENOENT if the ICMP is not registered.
     141 * @return              The found ICMP phone.
     142 * @return              ENOENT if the ICMP is not registered.
    143143 */
    144144static int ip_get_icmp_phone(void)
     
    160160 * @param[in] packet    The packet or the packet queue to be reported as faulty.
    161161 * @param[in] header    The first packet IP header. May be NULL.
    162  * @returns             EOK on success.
    163  * @returns             EINVAL if there are no data in the packet.
    164  * @returns             EINVAL if the packet is a fragment.
    165  * @returns             ENOMEM if the packet is too short to contain the IP
     162 * @return              EOK on success.
     163 * @return              EINVAL if there are no data in the packet.
     164 * @return              EINVAL if the packet is a fragment.
     165 * @return              ENOMEM if the packet is too short to contain the IP
    166166 *                      header.
    167  * @returns             EAFNOSUPPORT if the address family is not supported.
    168  * @returns             EPERM if the protocol is not allowed to send ICMP
     167 * @return              EAFNOSUPPORT if the address family is not supported.
     168 * @return              EPERM if the protocol is not allowed to send ICMP
    169169 *                      notifications. The ICMP protocol itself.
    170  * @returns             Other error codes as defined for the packet_set_addr().
     170 * @return              Other error codes as defined for the packet_set_addr().
    171171 */
    172172static int ip_prepare_icmp(packet_t packet, ip_header_t *header)
     
    227227 * @param[in] packet    The packet or the packet queue to be reported as faulty.
    228228 * @param[in] header    The first packet IP header. May be NULL.
    229  * @returns             The found ICMP phone.
    230  * @returns             EINVAL if the error parameter is set.
    231  * @returns             EINVAL if the ICMP phone is not found.
    232  * @returns             EINVAL if the ip_prepare_icmp() fails.
     229 * @return              The found ICMP phone.
     230 * @return              EINVAL if the error parameter is set.
     231 * @return              EINVAL if the ICMP phone is not found.
     232 * @return              EINVAL if the ip_prepare_icmp() fails.
    233233 */
    234234static int
     
    248248 * @param[in] client_connection The client connection processing function. The
    249249 *                      module skeleton propagates its own one.
    250  * @returns             EOK on success.
    251  * @returns             ENOMEM if there is not enough memory left.
     250 * @return              EOK on success.
     251 * @return              ENOMEM if there is not enough memory left.
    252252 */
    253253int ip_initialize(async_client_conn_t client_connection)
     
    293293 *
    294294 * @param[in,out] ip_netif Network interface specific data.
    295  * @returns             EOK on success.
    296  * @returns             ENOTSUP if DHCP is configured.
    297  * @returns             ENOTSUP if IPv6 is configured.
    298  * @returns             EINVAL if any of the addresses is invalid.
    299  * @returns             EINVAL if the used ARP module is not known.
    300  * @returns             ENOMEM if there is not enough memory left.
    301  * @returns             Other error codes as defined for the
     295 * @return              EOK on success.
     296 * @return              ENOTSUP if DHCP is configured.
     297 * @return              ENOTSUP if IPv6 is configured.
     298 * @return              EINVAL if any of the addresses is invalid.
     299 * @return              EINVAL if the used ARP module is not known.
     300 * @return              ENOMEM if there is not enough memory left.
     301 * @return              Other error codes as defined for the
    302302 *                      net_get_device_conf_req() function.
    303  * @returns             Other error codes as defined for the bind_service()
     303 * @return              Other error codes as defined for the bind_service()
    304304 *                      function.
    305  * @returns             Other error codes as defined for the specific
     305 * @return              Other error codes as defined for the specific
    306306 *                      arp_device_req() function.
    307  * @returns             Other error codes as defined for the
     307 * @return              Other error codes as defined for the
    308308 *                      nil_packet_size_req() function.
    309309 */
     
    486486 * @param[in] device_id The device identifier.
    487487 * @param[in] mtu       The new mtu value.
    488  * @returns             EOK on success.
    489  * @returns             ENOENT if device is not found.
     488 * @return              EOK on success.
     489 * @return              ENOENT if device is not found.
    490490 */
    491491static int ip_mtu_changed_message(device_id_t device_id, size_t mtu)
     
    511511 * @param[in] device_id The device identifier.
    512512 * @param[in] state     The new state value.
    513  * @returns             EOK on success.
    514  * @returns             ENOENT if device is not found.
     513 * @return              EOK on success.
     514 * @return              ENOENT if device is not found.
    515515 */
    516516static int ip_device_state_message(device_id_t device_id, device_state_t state)
     
    539539 * @param[in] packet    The packet to be prefixed.
    540540 * @param[in] last      The last header to be copied.
    541  * @returns             The prefixed middle header.
    542  * @returns             NULL on error.
     541 * @return              The prefixed middle header.
     542 * @return              NULL on error.
    543543 */
    544544static ip_header_t *
     
    613613 * @param[in,out] packet The packet to be sent.
    614614 * @param[in] destination The destination hardware address.
    615  * @returns             EOK on success.
    616  * @returns             EINVAL if the packet is too small to contain the IP
     615 * @return              EOK on success.
     616 * @return              EINVAL if the packet is too small to contain the IP
    617617 *                      header.
    618  * @returns             EINVAL if the packet is too long than the IP allows.
    619  * @returns             ENOMEM if there is not enough memory left.
    620  * @returns             Other error codes as defined for the packet_set_addr()
     618 * @return              EINVAL if the packet is too long than the IP allows.
     619 * @return              ENOMEM if there is not enough memory left.
     620 * @return              Other error codes as defined for the packet_set_addr()
    621621 *                      function.
    622622 */
     
    746746 * @param[in] dest      The destiantion address.
    747747 * @param[in] addrlen   The address length.
    748  * @returns             EOK on success.
    749  * @returns             ENOMEM if the target packet is too small.
    750  * @returns             Other error codes as defined for the packet_set_addr()
     748 * @return              EOK on success.
     749 * @return              ENOMEM if the target packet is too small.
     750 * @return              Other error codes as defined for the packet_set_addr()
    751751 *                      function.
    752  * @returns             Other error codes as defined for the pq_insert_after()
     752 * @return              Other error codes as defined for the pq_insert_after()
    753753 *                      function.
    754754 */
     
    799799 * @param[in] suffix    The minimum suffix size.
    800800 * @param[in] addr_len  The minimum address length.
    801  * @returns             EOK on success.
    802  * @returns             EINVAL if the packet_get_addr() function fails.
    803  * @returns             EINVAL if the packet does not contain the IP header.
    804  * @returns             EPERM if the packet needs to be fragmented and the
     801 * @return              EOK on success.
     802 * @return              EINVAL if the packet_get_addr() function fails.
     803 * @return              EINVAL if the packet does not contain the IP header.
     804 * @return              EPERM if the packet needs to be fragmented and the
    805805 *                      fragmentation is not allowed.
    806  * @returns             ENOMEM if there is not enough memory left.
    807  * @returns             ENOMEM if there is no packet available.
    808  * @returns             ENOMEM if the packet is too small to contain the IP
     806 * @return              ENOMEM if there is not enough memory left.
     807 * @return              ENOMEM if there is no packet available.
     808 * @return              ENOMEM if the packet is too small to contain the IP
    809809 *                      header.
    810  * @returns             Other error codes as defined for the packet_trim()
     810 * @return              Other error codes as defined for the packet_trim()
    811811 *                      function.
    812  * @returns             Other error codes as defined for the
     812 * @return              Other error codes as defined for the
    813813 *                      ip_create_middle_header() function.
    814  * @returns             Other error codes as defined for the
     814 * @return              Other error codes as defined for the
    815815 *                      ip_fragment_packet_data() function.
    816816 */
     
    919919 * @param[in] addr_len  The minimum address length.
    920920 * @param[in] error     The error module service.
    921  * @returns             The packet or the packet queue of the allowed length.
    922  * @returns             NULL if there are no packets left.
     921 * @return              The packet or the packet queue of the allowed length.
     922 * @return              NULL if there are no packets left.
    923923 */
    924924static packet_t
     
    986986 * @param[in] dest      The destination address.
    987987 * @param[in] error     The error module service.
    988  * @returns             EOK on success.
    989  * @returns             Other error codes as defined for the arp_translate_req()
     988 * @return              EOK on success.
     989 * @return              Other error codes as defined for the arp_translate_req()
    990990 *                      function.
    991  * @returns             Other error codes as defined for the ip_prepare_packet()
     991 * @return              Other error codes as defined for the ip_prepare_packet()
    992992 *                      function.
    993993 */
     
    10621062 *                      NULL.
    10631063 * @param[in] destination The destination address.
    1064  * @returns             The found route.
    1065  * @returns             NULL if no route was found.
     1064 * @return              The found route.
     1065 * @return              NULL if no route was found.
    10661066 */
    10671067static ip_route_t *
     
    10901090 *
    10911091 * @param[in] destination The destination address.
    1092  * @returns             The found route.
    1093  * @returns             NULL if no route was found.
     1092 * @return              The found route.
     1093 * @return              NULL if no route was found.
    10941094 */
    10951095static ip_route_t *ip_find_route(in_addr_t destination) {
     
    11161116 *
    11171117 * @param[in] netif     The network interface.
    1118  * @returns             The IP address.
    1119  * @returns             NULL if no IP address was found.
     1118 * @return              The IP address.
     1119 * @return              NULL if no IP address was found.
    11201120 */
    11211121static in_addr_t *ip_netif_address(ip_netif_t *netif)
     
    11361136 * @param[in] phone     The transport layer module phone.
    11371137 * @param[in] received_msg The receiving function.
    1138  * @returns             EOK on success.
    1139  * @returns             EINVAL if the protocol parameter and/or the service
     1138 * @return              EOK on success.
     1139 * @return              EINVAL if the protocol parameter and/or the service
    11401140 *                      parameter is zero.
    1141  * @returns             EINVAL if the phone parameter is not a positive number
     1141 * @return              EINVAL if the phone parameter is not a positive number
    11421142 *                      and the tl_receive_msg is NULL.
    1143  * @returns             ENOMEM if there is not enough memory left.
     1143 * @return              ENOMEM if there is not enough memory left.
    11441144 */
    11451145static int
     
    13611361 * @param[out] content  The maximum content size.
    13621362 * @param[out] suffix   The minimum reserved suffix size.
    1363  * @returns             EOK on success.
     1363 * @return              EOK on success.
    13641364 */
    13651365static int
     
    14181418 *
    14191419 * @param[in] header    The packet IP header to be read.
    1420  * @returns             The packet destination address.
     1420 * @return              The packet destination address.
    14211421 */
    14221422static in_addr_t ip_get_destination(ip_header_t *header)
     
    14391439 * @param[in] header    The first packet IP header. May be NULL.
    14401440 * @param[in] error     The packet error service.
    1441  * @returns             EOK on success.
    1442  * @returns             ENOTSUP if the packet is a fragment.
    1443  * @returns             EAFNOSUPPORT if the address family is not supported.
    1444  * @returns             ENOENT if the target protocol is not found.
    1445  * @returns             Other error codes as defined for the packet_set_addr()
     1441 * @return              EOK on success.
     1442 * @return              ENOTSUP if the packet is a fragment.
     1443 * @return              EAFNOSUPPORT if the address family is not supported.
     1444 * @return              ENOENT if the target protocol is not found.
     1445 * @return              Other error codes as defined for the packet_set_addr()
    14461446 *                      function.
    1447  * @returns             Other error codes as defined for the packet_trim()
     1447 * @return              Other error codes as defined for the packet_trim()
    14481448 *                      function.
    1449  * @returns             Other error codes as defined for the protocol specific
     1449 * @return              Other error codes as defined for the protocol specific
    14501450 *                      tl_received_msg() function.
    14511451 */
     
    15441544 * @param[in] device_id The source device identifier.
    15451545 * @param[in] packet    The received packet to be processed.
    1546  * @returns             EOK on success.
    1547  * @returns             EINVAL if the TTL is less than two.
    1548  * @returns             EINVAL if the checksum is invalid.
    1549  * @returns             EAFNOSUPPORT if the address family is not supported.
    1550  * @returns             ENOENT if no route was found.
    1551  * @returns             ENOENT if the packet is for another host and the routing
     1546 * @return              EOK on success.
     1547 * @return              EINVAL if the TTL is less than two.
     1548 * @return              EINVAL if the checksum is invalid.
     1549 * @return              EAFNOSUPPORT if the address family is not supported.
     1550 * @return              ENOENT if no route was found.
     1551 * @return              ENOENT if the packet is for another host and the routing
    15521552 *                      is disabled.
    15531553 */
     
    18491849 * @param[in] device_id The source device identifier.
    18501850 * @param[in,out] packet The received packet.
    1851  * @returns             EOK on success and the packet is no longer needed.
    1852  * @returns             EINVAL if the packet is too small to carry the IP
     1851 * @return              EOK on success and the packet is no longer needed.
     1852 * @return              EINVAL if the packet is too small to carry the IP
    18531853 *                      packet.
    1854  * @returns             EINVAL if the received address lengths differs from the
     1854 * @return              EINVAL if the received address lengths differs from the
    18551855 *                      registered values.
    1856  * @returns             ENOENT if the device is not found in the cache.
    1857  * @returns             ENOENT if the protocol for the device is not found in
     1856 * @return              ENOENT if the device is not found in the cache.
     1857 * @return              ENOENT if the protocol for the device is not found in
    18581858 *                      the cache.
    1859  * @returns             ENOMEM if there is not enough memory left.
     1859 * @return              ENOMEM if there is not enough memory left.
    18601860 */
    18611861static int ip_receive_message(device_id_t device_id, packet_t packet)
     
    18791879 * @param[out] answer_count The last parameter for the actual answer in the
    18801880 *                      answer parameter.
    1881  * @returns             EOK on success.
    1882  * @returns             ENOTSUP if the message is not known.
     1881 * @return              EOK on success.
     1882 * @return              ENOTSUP if the message is not known.
    18831883 *
    18841884 * @see ip_interface.h
     
    20372037/** Starts the module.
    20382038 *
    2039  * @returns EOK on success.
    2040  * @returns Other error codes as defined for each specific module start function.
     2039 * @return EOK on success.
     2040 * @return Other error codes as defined for each specific module start function.
    20412041 */
    20422042int main(int argc, char *argv[])
Note: See TracChangeset for help on using the changeset viewer.