Changeset b4ff8a6d in mainline for uspace/srv/net/tl/tl_common.c


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

File:
1 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        }
Note: See TracChangeset for help on using the changeset viewer.