Changeset 91478aa in mainline for uspace/srv/net/tl


Ignore:
Timestamp:
2010-02-17T23:20:41Z (16 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b87284, ca2d142
Parents:
536ded4
Message:
  • unify packet dimension interfaces
Location:
uspace/srv/net/tl
Files:
5 edited

Legend:

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

    r536ded4 r91478aa  
    287287        length = ( size_t ) addrlen;
    288288        // TODO do not ask all the time
    289         ERROR_PROPAGATE( ip_packet_size_req( icmp_globals.ip_phone, -1, & icmp_globals.addr_len, & icmp_globals.prefix, & icmp_globals.content, & icmp_globals.suffix ));
    290         packet = packet_get_4( icmp_globals.net_phone, size, icmp_globals.addr_len, ICMP_HEADER_SIZE + icmp_globals.prefix, icmp_globals.suffix );
     289        ERROR_PROPAGATE( ip_packet_size_req( icmp_globals.ip_phone, -1, & icmp_globals.packet_dimension ));
     290        packet = packet_get_4( icmp_globals.net_phone, size, icmp_globals.packet_dimension.addr_len, ICMP_HEADER_SIZE + icmp_globals.packet_dimension.prefix, icmp_globals.packet_dimension.suffix );
    291291        if( ! packet ) return ENOMEM;
    292292
     
    477477                return icmp_globals.ip_phone;
    478478        }
    479         ERROR_PROPAGATE( ip_packet_size_req( icmp_globals.ip_phone, -1, & icmp_globals.addr_len, & icmp_globals.prefix, & icmp_globals.content, & icmp_globals.suffix ));
    480         icmp_globals.prefix += ICMP_HEADER_SIZE;
    481         icmp_globals.content -= ICMP_HEADER_SIZE;
     479        ERROR_PROPAGATE( ip_packet_size_req( icmp_globals.ip_phone, -1, & icmp_globals.packet_dimension ));
     480        icmp_globals.packet_dimension.prefix += ICMP_HEADER_SIZE;
     481        icmp_globals.packet_dimension.content -= ICMP_HEADER_SIZE;
    482482        // get configuration
    483483        icmp_globals.error_reporting = NET_DEFAULT_ICMP_ERROR_REPORTING;
  • uspace/srv/net/tl/icmp/icmp.h

    r536ded4 r91478aa  
    9494         */
    9595        int                             ip_phone;
    96         /** Reserved packet prefix length.
     96        /** Packet dimension.
    9797         */
    98         size_t                  prefix;
    99         /** Maximal packet content length.
    100          */
    101         size_t                  content;
    102         /** Reserved packet suffix length.
    103          */
    104         size_t                  suffix;
    105         /** Packet address length.
    106          */
    107         size_t                  addr_len;
     98        packet_dimension_t      packet_dimension;
    10899        /** Networking module phone.
    109100         */
  • uspace/srv/net/tl/tl_common.c

    r536ded4 r91478aa  
    8989                * packet_dimension = malloc( sizeof( ** packet_dimension ));
    9090                if( ! * packet_dimension ) return ENOMEM;
    91                 if( ERROR_OCCURRED( ip_packet_size_req( ip_phone, device_id, & ( ** packet_dimension ).addr_len, & ( ** packet_dimension ).prefix, & ( ** packet_dimension ).content, & ( ** packet_dimension ).suffix ))){
     91                if( ERROR_OCCURRED( ip_packet_size_req( ip_phone, device_id, * packet_dimension ))){
    9292                        free( * packet_dimension );
    9393                        return ERROR_CODE;
  • uspace/srv/net/tl/tl_common.h

    r536ded4 r91478aa  
    4343#include "../include/inet.h"
    4444#include "../include/socket_codes.h"
    45 
    46 /** Type definition of the packet dimension.
    47  *  @see packet_dimension
    48  */
    49 typedef struct packet_dimension packet_dimension_t;
    50 
    51 /** Type definition of the packet dimension pointer.
    52  *  @see packet_dimension
    53  */
    54 typedef packet_dimension_t *    packet_dimension_ref;
    55 
    56 /** Packet dimension.
    57  */
    58 struct packet_dimension{
    59         /** Reserved packet prefix length.
    60          */
    61         size_t                  prefix;
    62         /** Maximal packet content length.
    63          */
    64         size_t                  content;
    65         /** Reserved packet suffix length.
    66          */
    67         size_t                  suffix;
    68         /** Maximal packet address length.
    69          */
    70         size_t                  addr_len;
    71 };
    7245
    7346/** Device packet dimensions.
  • uspace/srv/net/tl/udp/udp.c

    r536ded4 r91478aa  
    205205        }
    206206        // read default packet dimensions
    207         ERROR_PROPAGATE( ip_packet_size_req( udp_globals.ip_phone, -1, & udp_globals.packet_dimension.addr_len, & udp_globals.packet_dimension.prefix, & udp_globals.packet_dimension.content, & udp_globals.packet_dimension.suffix ));
     207        ERROR_PROPAGATE( ip_packet_size_req( udp_globals.ip_phone, -1, & udp_globals.packet_dimension ));
    208208        ERROR_PROPAGATE( socket_ports_initialize( & udp_globals.sockets ));
    209209        if( ERROR_OCCURRED( packet_dimensions_initialize( & udp_globals.dimensions ))){
     
    579579//      }else{
    580580                // do not ask all the time
    581                 ERROR_PROPAGATE( ip_packet_size_req( udp_globals.ip_phone, -1, & udp_globals.packet_dimension.addr_len, & udp_globals.packet_dimension.prefix, & udp_globals.packet_dimension.content, & udp_globals.packet_dimension.suffix ));
     581                ERROR_PROPAGATE( ip_packet_size_req( udp_globals.ip_phone, -1, & udp_globals.packet_dimension ));
    582582                packet_dimension = & udp_globals.packet_dimension;
    583583//      }
Note: See TracChangeset for help on using the changeset viewer.