Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/il/ip_remote.c

    r46d4d9f r779a47d  
    2727 */
    2828
    29 /** @addtogroup libnet
     29/** @addtogroup ip
    3030 * @{
    3131 */
     
    5757 * The target network is routed using this device.
    5858 *
    59  * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
    60  * @param[in] device_id The device identifier.
    61  * @param[in] address   The target network address.
    62  * @param[in] netmask   The target network mask.
    63  * @param[in] gateway   The target network gateway. Not used if zero.
     59 * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
     60 * @param[in] device_id The device identifier.
     61 * @param[in] address   The target network address.
     62 * @param[in] netmask   The target network mask.
     63 * @param[in] gateway   The target network gateway. Not used if zero.
     64 *
    6465 */
    6566int ip_add_route_req_remote(int ip_phone, device_id_t device_id,
     
    7172}
    7273
    73 /** Creates bidirectional connection with the ip module service and registers
    74  * the message receiver.
    75  *
    76  * @param[in] service   The IP module service.
    77  * @param[in] protocol  The transport layer protocol.
    78  * @param[in] me        The requesting module service.
    79  * @param[in] receiver  The message receiver. Used for remote connection.
    80  * @return              The phone of the needed service.
    81  * @return              EOK on success.
    82  * @return              Other error codes as defined for the bind_service()
    83  *                      function.
    84  */
    8574int ip_bind_service(services_t service, int protocol, services_t me,
    8675    async_client_conn_t receiver)
     
    9079}
    9180
    92 /** Connects to the IP module.
    93  *
    94  * @param service       The IP module service. Ignored parameter.
    95  * @return              The IP module phone on success.
    96  */
    9781int ip_connect_module(services_t service)
    9882{
     
    10589 * If the device uses ARP registers also the new ARP device.
    10690 *
    107  * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
    108  * @param[in] device_id The new device identifier.
    109  * @param[in] netif     The underlying device network interface layer service.
    110  * @return              EOK on success.
    111  * @return              ENOMEM if there is not enough memory left.
    112  * @return              EINVAL if the device configuration is invalid.
    113  * @return              ENOTSUP if the device uses IPv6.
    114  * @return              ENOTSUP if the device uses DHCP.
    115  * @return              Other error codes as defined for the
    116  *                      net_get_device_conf_req() function.
    117  * @return              Other error codes as defined for the arp_device_req()
    118  *                      function.
     91 * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
     92 * @param[in] device_id The new device identifier.
     93 * @param[in] netif     The underlying device network interface layer service.
     94 *
     95 * @return EOK on success.
     96 * @return ENOMEM if there is not enough memory left.
     97 * @return EINVAL if the device configuration is invalid.
     98 * @return ENOTSUP if the device uses IPv6.
     99 * @return ENOTSUP if the device uses DHCP.
     100 * @return Other error codes as defined for the net_get_device_conf_req()
     101 *         function.
     102 * @return Other error codes as defined for the arp_device_req() function.
     103 *
    119104 */
    120105int ip_device_req_remote(int ip_phone, device_id_t device_id,
     
    125110}
    126111
    127 /** Return the device identifier and the IP pseudo header based on the
    128  * destination address.
    129  *
    130  * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
    131  * @param[in] protocol  The transport protocol.
    132  * @param[in] destination The destination address.
    133  * @param[in] addrlen   The destination address length.
    134  * @param[out] device_id The device identifier.
    135  * @param[out] header   The constructed IP pseudo header.
    136  * @param[out] headerlen The IP pseudo header length.
     112/** Return the device identifier and the IP pseudo header based on the destination address.
     113 *
     114 * @param[in]  ip_phone    The IP module phone used for (semi)remote calls.
     115 * @param[in]  protocol    The transport protocol.
     116 * @param[in]  destination The destination address.
     117 * @param[in]  addrlen     The destination address length.
     118 * @param[out] device_id   The device identifier.
     119 * @param[out] header      The constructed IP pseudo header.
     120 * @param[out] headerlen   The IP pseudo header length.
    137121 *
    138122 */
     
    141125    device_id_t *device_id, void **header, size_t *headerlen)
    142126{
    143         if (!destination || (addrlen == 0))
     127        if ((!destination) || (addrlen == 0))
    144128                return EINVAL;
    145129       
    146         if (!device_id || !header || !headerlen)
     130        if ((!device_id) || (!header) || (!headerlen))
    147131                return EBADMEM;
    148132       
     
    153137            (ipcarg_t) protocol, &answer);
    154138       
    155         if ((async_data_write_start(ip_phone, destination, addrlen) == EOK) &&
    156             (async_data_read_start(ip_phone, headerlen,
    157             sizeof(*headerlen)) == EOK) && (*headerlen > 0)) {
     139        if ((async_data_write_start(ip_phone, destination, addrlen) == EOK)
     140            && (async_data_read_start(ip_phone, headerlen, sizeof(*headerlen)) == EOK)
     141            && (*headerlen > 0)) {
    158142                *header = malloc(*headerlen);
    159143                if (*header) {
    160                         if (async_data_read_start(ip_phone, *header,
    161                             *headerlen) != EOK)
     144                        if (async_data_read_start(ip_phone, *header, *headerlen) != EOK)
    162145                                free(*header);
    163146                }
     
    167150        async_wait_for(message_id, &result);
    168151       
    169         if ((result != EOK) && *header)
     152        if ((result != EOK) && (*header))
    170153                free(*header);
    171154        else
     
    177160/** Return the device packet dimension for sending.
    178161 *
    179  * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
    180  * @param[in] device_id The device identifier.
     162 * @param[in]  ip_phone         The IP module phone used for (semi)remote calls.
     163 * @param[in]  device_id        The device identifier.
    181164 * @param[out] packet_dimension The packet dimension.
    182  * @return              EOK on success.
    183  * @return              ENOENT if there is no such device.
    184  * @return              Other error codes as defined for the
    185  *                      generic_packet_size_req_remote() function.
     165 *
     166 * @return EOK on success.
     167 * @return ENOENT if there is no such device.
     168 * @return Other error codes as defined for the
     169 *         generic_packet_size_req_remote() function.
     170 *
    186171 */
    187172int ip_packet_size_req_remote(int ip_phone, device_id_t device_id,
    188     packet_dimension_t *packet_dimension)
    189 {
    190         return generic_packet_size_req_remote(ip_phone, NET_IL_PACKET_SPACE,
    191             device_id, packet_dimension);
     173    packet_dimension_ref packet_dimension)
     174{
     175        return generic_packet_size_req_remote(ip_phone, NET_IL_PACKET_SPACE, device_id,
     176            packet_dimension);
    192177}
    193178
    194179/** Notify the IP module about the received error notification packet.
    195180 *
    196  * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
    197  * @param[in] device_id The device identifier.
    198  * @param[in] packet    The received packet or the received packet queue.
    199  * @param[in] target    The target internetwork module service to be
    200  *                      delivered to.
    201  * @param[in] error     The packet error reporting service. Prefixes the
    202  *                      received packet.
    203  * @return              EOK on success.
     181 * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
     182 * @param[in] device_id The device identifier.
     183 * @param[in] packet    The received packet or the received packet queue.
     184 * @param[in] target    The target internetwork module service to be
     185 *                      delivered to.
     186 * @param[in] error     The packet error reporting service. Prefixes the
     187 *                      received packet.
     188 *
     189 * @return EOK on success.
     190 *
    204191 */
    205192int ip_received_error_msg_remote(int ip_phone, device_id_t device_id,
    206     packet_t *packet, services_t target, services_t error)
     193    packet_t packet, services_t target, services_t error)
    207194{
    208195        return generic_received_msg_remote(ip_phone, NET_IP_RECEIVED_ERROR,
     
    214201 * The packets may get fragmented if needed.
    215202 *
    216  * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
    217  * @param[in] device_id The device identifier.
    218  * @param[in] packet    The packet fragments as a packet queue. All the
    219  *                      packets have to have the same destination address.
    220  * @param[in] sender    The sending module service.
    221  * @param[in] error     The packet error reporting service. Prefixes the
    222  *                      received packet.
    223  * @return              EOK on success.
    224  * @return              Other error codes as defined for the generic_send_msg()
    225  *                      function.
    226  */
    227 int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t *packet,
     203 * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
     204 * @param[in] device_id The device identifier.
     205 * @param[in] packet    The packet fragments as a packet queue. All the
     206 *                      packets have to have the same destination address.
     207 * @param[in] sender    The sending module service.
     208 * @param[in] error     The packet error reporting service. Prefixes the
     209 *                      received packet.
     210 *
     211 * @return EOK on success.
     212 * @return Other error codes as defined for the generic_send_msg() function.
     213 *
     214 */
     215int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t packet,
    228216    services_t sender, services_t error)
    229217{
     
    236224 * This gateway is used if no other route is found.
    237225 *
    238  * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
    239  * @param[in] device_id The device identifier.
    240  * @param[in] gateway   The default gateway.
     226 * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
     227 * @param[in] device_id The device identifier.
     228 * @param[in] gateway   The default gateway.
     229 *
    241230 */
    242231int ip_set_gateway_req_remote(int ip_phone, device_id_t device_id,
Note: See TracChangeset for help on using the changeset viewer.