Changeset b4ff8a6d in mainline


Ignore:
Timestamp:
2010-01-04T17:57:33Z (14 years ago)
Author:
Lukas Mejdrech <lukas@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e18892
Parents:
c92a5753
Message:

+ tl packet dimension cache update function

Location:
uspace/srv/net/tl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/tl_common.c

    rc92a5753 rb4ff8a6d  
    4444#include "../structures/packet/packet_client.h"
    4545
     46#include "../include/device.h"
    4647#include "../include/icmp_interface.h"
    4748#include "../include/in.h"
     
    9697                        free( * packet_dimension );
    9798                        return ERROR_CODE;
     99                }
     100        }
     101        return EOK;
     102}
     103
     104int tl_update_ip_packet_dimension( packet_dimensions_ref packet_dimensions, device_id_t device_id, size_t content ){
     105        packet_dimension_ref    packet_dimension;
     106
     107        packet_dimension = packet_dimensions_find( packet_dimensions, device_id );
     108        if( ! packet_dimension ) return ENOENT;
     109        packet_dimension->content = content;
     110        if( device_id != DEVICE_INVALID_ID ){
     111                packet_dimension = packet_dimensions_find( packet_dimensions, DEVICE_INVALID_ID );
     112                if( packet_dimension ){
     113                        if( packet_dimension->content >= content ){
     114                                packet_dimension->content = content;
     115                        }else{
     116                                packet_dimensions_exclude( packet_dimensions, DEVICE_INVALID_ID );
     117                        }
    98118                }
    99119        }
  • uspace/srv/net/tl/tl_common.h

    rc92a5753 rb4ff8a6d  
    103103int     tl_get_ip_packet_dimension( int ip_phone, packet_dimensions_ref packet_dimensions, device_id_t device_id, packet_dimension_ref * packet_dimension );
    104104
     105/** Updates IP device packet dimensions cache.
     106 *  @param[in,out] packet_dimensions The packet dimensions cache.
     107 *  @param[in] device_id The device identifier.
     108 *  @param[in] content The new maximum content size.
     109 *  @returns EOK on success.
     110 *  @returns ENOENT if the packet dimension is not cached.
     111 */
     112int     tl_update_ip_packet_dimension( packet_dimensions_ref packet_dimensions, device_id_t device_id, size_t content );
     113
    105114/** Sets the address port.
    106115 *  Supports AF_INET and AF_INET6 address families.
Note: See TracChangeset for help on using the changeset viewer.