Changeset fdbc3ff in mainline for uspace/srv/net/il/arp/arp.c


Ignore:
Timestamp:
2010-11-19T23:50:06Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46d4d9f
Parents:
b4c9c61 (diff), a9c6b966 (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 mainline changes.

File:
1 edited

Legend:

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

    rb4c9c61 rfdbc3ff  
    8383 * @param[in] device    The device specific data.
    8484 */
    85 static void arp_clear_device(arp_device_ref device)
     85static void arp_clear_device(arp_device_t *device)
    8686{
    8787        int count;
    88         arp_proto_ref proto;
     88        arp_proto_t *proto;
    8989
    9090        for (count = arp_protos_count(&device->protos) - 1; count >= 0;
     
    105105{
    106106        int count;
    107         arp_device_ref device;
     107        arp_device_t *device;
    108108
    109109        fibril_rwlock_write_lock(&arp_globals.lock);
     
    126126
    127127static int arp_clear_address_req(int arp_phone, device_id_t device_id,
    128     services_t protocol, measured_string_ref address)
    129 {
    130         arp_device_ref device;
    131         arp_proto_ref proto;
     128    services_t protocol, measured_string_t *address)
     129{
     130        arp_device_t *device;
     131        arp_proto_t *proto;
    132132
    133133        fibril_rwlock_write_lock(&arp_globals.lock);
     
    150150static int arp_clear_device_req(int arp_phone, device_id_t device_id)
    151151{
    152         arp_device_ref device;
     152        arp_device_t *device;
    153153
    154154        fibril_rwlock_write_lock(&arp_globals.lock);
     
    171171 * @param[in] service   The protocol module service.
    172172 * @param[in] address   The actual protocol device address.
    173  * @returns             EOK on success.
    174  * @returns             ENOMEM if there is not enough memory left.
    175  */
    176 static int arp_proto_create(arp_proto_ref *proto, services_t service,
    177     measured_string_ref address)
     173 * @return              EOK on success.
     174 * @return              ENOMEM if there is not enough memory left.
     175 */
     176static int arp_proto_create(arp_proto_t **proto, services_t service,
     177    measured_string_t *address)
    178178{
    179179        int rc;
    180180
    181         *proto = (arp_proto_ref) malloc(sizeof(arp_proto_t));
     181        *proto = (arp_proto_t *) malloc(sizeof(arp_proto_t));
    182182        if (!*proto)
    183183                return ENOMEM;
     
    205205 * @param[in] protocol  The protocol service.
    206206 * @param[in] address   The actual device protocol address.
    207  * @returns             EOK on success.
    208  * @returns             EEXIST if another device with the same device identifier
     207 * @return              EOK on success.
     208 * @return              EEXIST if another device with the same device identifier
    209209 *                      and different driver service exists.
    210  * @returns             ENOMEM if there is not enough memory left.
    211  * @returns             Other error codes as defined for the
     210 * @return              ENOMEM if there is not enough memory left.
     211 * @return              Other error codes as defined for the
    212212 *                      measured_strings_return() function.
    213213 */
    214214static int arp_device_message(device_id_t device_id, services_t service,
    215     services_t protocol, measured_string_ref address)
    216 {
    217         arp_device_ref device;
    218         arp_proto_ref proto;
     215    services_t protocol, measured_string_t *address)
     216{
     217        arp_device_t *device;
     218        arp_proto_t *proto;
    219219        hw_type_t hardware;
    220220        int index;
     
    260260               
    261261                /* Create a new device */
    262                 device = (arp_device_ref) malloc(sizeof(arp_device_t));
     262                device = (arp_device_t *) malloc(sizeof(arp_device_t));
    263263                if (!device) {
    264264                        fibril_rwlock_write_unlock(&arp_globals.lock);
     
    356356 *  @param[in] client_connection The client connection processing function.
    357357 *                      The module skeleton propagates its own one.
    358  *  @returns            EOK on success.
    359  *  @returns            ENOMEM if there is not enough memory left.
     358 *  @return             EOK on success.
     359 *  @return             ENOMEM if there is not enough memory left.
    360360 */
    361361int arp_initialize(async_client_conn_t client_connection)
     
    376376 * @param[in] device_id The device identifier.
    377377 * @param[in] mtu       The new mtu value.
    378  * @returns             ENOENT if device is not found.
    379  * @returns             EOK on success.
     378 * @return              ENOENT if device is not found.
     379 * @return              EOK on success.
    380380 */
    381381static int arp_mtu_changed_message(device_id_t device_id, size_t mtu)
    382382{
    383         arp_device_ref device;
     383        arp_device_t *device;
    384384
    385385        fibril_rwlock_write_lock(&arp_globals.lock);
     
    404404 * @param[in] device_id The source device identifier.
    405405 * @param[in,out] packet The received packet.
    406  * @returns             EOK on success and the packet is no longer needed.
    407  * @returns             One on success and the packet has been reused.
    408  * @returns             EINVAL if the packet is too small to carry an ARP
     406 * @return              EOK on success and the packet is no longer needed.
     407 * @return              One on success and the packet has been reused.
     408 * @return              EINVAL if the packet is too small to carry an ARP
    409409 *                      packet.
    410  * @returns             EINVAL if the received address lengths differs from
     410 * @return              EINVAL if the received address lengths differs from
    411411 *                      the registered values.
    412  * @returns             ENOENT if the device is not found in the cache.
    413  * @returns             ENOENT if the protocol for the device is not found in
     412 * @return              ENOENT if the device is not found in the cache.
     413 * @return              ENOENT if the protocol for the device is not found in
    414414 *                      the cache.
    415  * @returns             ENOMEM if there is not enough memory left.
     415 * @return              ENOMEM if there is not enough memory left.
    416416 */
    417417static int arp_receive_message(device_id_t device_id, packet_t packet)
    418418{
    419419        size_t length;
    420         arp_header_ref header;
    421         arp_device_ref device;
    422         arp_proto_ref proto;
    423         measured_string_ref hw_source;
     420        arp_header_t *header;
     421        arp_device_t *device;
     422        arp_proto_t *proto;
     423        measured_string_t *hw_source;
    424424        uint8_t *src_hw;
    425425        uint8_t *src_proto;
     
    436436                return ENOENT;
    437437
    438         header = (arp_header_ref) packet_get_data(packet);
     438        header = (arp_header_t *) packet_get_data(packet);
    439439        if ((ntohs(header->hardware) != device->hardware) ||
    440440            (length < sizeof(arp_header_t) + header->hardware_length * 2U +
     
    516516 * @param[in] protocol  The protocol service.
    517517 * @param[in] target    The target protocol address.
    518  * @returns             The hardware address of the target.
    519  * @returns             NULL if the target parameter is NULL.
    520  * @returns             NULL if the device is not found.
    521  * @returns             NULL if the device packet is too small to send a
     518 * @return              The hardware address of the target.
     519 * @return              NULL if the target parameter is NULL.
     520 * @return              NULL if the device is not found.
     521 * @return              NULL if the device packet is too small to send a
    522522 *                      request.
    523  * @returns             NULL if the hardware address is not found in the cache.
    524  */
    525 static measured_string_ref
     523 * @return              NULL if the hardware address is not found in the cache.
     524 */
     525static measured_string_t *
    526526arp_translate_message(device_id_t device_id, services_t protocol,
    527     measured_string_ref target)
    528 {
    529         arp_device_ref device;
    530         arp_proto_ref proto;
    531         measured_string_ref addr;
     527    measured_string_t *target)
     528{
     529        arp_device_t *device;
     530        arp_proto_t *proto;
     531        measured_string_t *addr;
    532532        size_t length;
    533533        packet_t packet;
    534         arp_header_ref header;
     534        arp_header_t *header;
    535535
    536536        if (!target)
     
    561561                return NULL;
    562562
    563         header = (arp_header_ref) packet_suffix(packet, length);
     563        header = (arp_header_t *) packet_suffix(packet, length);
    564564        if (!header) {
    565565                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
     
    602602 * @param[out] answer_count The last parameter for the actual answer in the
    603603 *                      answer parameter.
    604  * @returns             EOK on success.
    605  * @returns             ENOTSUP if the message is not known.
     604 * @return              EOK on success.
     605 * @return              ENOTSUP if the message is not known.
    606606 *
    607607 * @see arp_interface.h
     
    612612    ipc_call_t *answer, int *answer_count)
    613613{
    614         measured_string_ref address;
    615         measured_string_ref translation;
     614        measured_string_t *address;
     615        measured_string_t *translation;
    616616        char *data;
    617617        packet_t packet;
     
    747747/** Starts the module.
    748748 *
    749  * @returns             EOK on success.
    750  * @returns             Other error codes as defined for each specific module
     749 * @return              EOK on success.
     750 * @return              Other error codes as defined for each specific module
    751751 *                      start function.
    752752 */
Note: See TracChangeset for help on using the changeset viewer.