Changeset 89c57b6 in mainline for uspace/srv/net/il/arp/arp.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (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.h

    rcefb126 r89c57b6  
    2828
    2929/** @addtogroup arp
    30  *  @{
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  ARP module.
     34 * ARP module.
    3535 */
    3636
    37 #ifndef __NET_ARP_H__
    38 #define __NET_ARP_H__
     37#ifndef NET_ARP_H_
     38#define NET_ARP_H_
    3939
    4040#include <fibril_synch.h>
    41 
    42 #include <ipc/ipc.h>
    4341#include <ipc/services.h>
    44 
    45 #include <net_device.h>
     42#include <net/device.h>
     43#include <net/packet.h>
    4644#include <net_hardware.h>
    4745#include <adt/generic_char_map.h>
     
    4947#include <adt/measured_strings.h>
    5048
    51 
    5249/** Type definition of the ARP device specific data.
    53  *  @see arp_device
     50 * @see arp_device
    5451 */
    55 typedef struct arp_device       arp_device_t;
    56 
    57 /** Type definition of the ARP device specific data pointer.
    58  *  @see arp_device
    59  */
    60 typedef arp_device_t *          arp_device_ref;
     52typedef struct arp_device arp_device_t;
    6153
    6254/** Type definition of the ARP global data.
    63  *  @see arp_globals
     55 * @see arp_globals
    6456 */
    65 typedef struct arp_globals      arp_globals_t;
     57typedef struct arp_globals arp_globals_t;
    6658
    6759/** Type definition of the ARP protocol specific data.
    68  *  @see arp_proto
     60 * @see arp_proto
    6961 */
    70 typedef struct arp_proto        arp_proto_t;
     62typedef struct arp_proto arp_proto_t;
    7163
    72 /** Type definition of the ARP protocol specific data pointer.
    73  *  @see arp_proto
     64/** Type definition of the ARP address translation record.
     65 * @see arp_trans
    7466 */
    75 typedef arp_proto_t *           arp_proto_ref;
     67typedef struct arp_trans arp_trans_t;
    7668
    7769/** ARP address map.
    78  *  Translates addresses.
    79  *  @see generic_char_map.h
     70 *
     71 * Translates addresses.
     72 * @see generic_char_map.h
    8073 */
    81 GENERIC_CHAR_MAP_DECLARE(arp_addr, measured_string_t)
     74GENERIC_CHAR_MAP_DECLARE(arp_addr, arp_trans_t);
    8275
    8376/** ARP address cache.
    84  *  Maps devices to the ARP device specific data.
    85  *  @see device.h
     77 *
     78 * Maps devices to the ARP device specific data.
     79 * @see device.h
    8680 */
    87 DEVICE_MAP_DECLARE(arp_cache, arp_device_t)
     81DEVICE_MAP_DECLARE(arp_cache, arp_device_t);
    8882
    8983/** ARP protocol map.
    90  *  Maps protocol identifiers to the ARP protocol specific data.
    91  *  @see int_map.h
     84 *
     85 * Maps protocol identifiers to the ARP protocol specific data.
     86 * @see int_map.h
    9287 */
    93 INT_MAP_DECLARE(arp_protos, arp_proto_t)
     88INT_MAP_DECLARE(arp_protos, arp_proto_t);
    9489
    95 /** ARP device specific data.
    96  */
    97 struct arp_device{
    98         /** Actual device hardware address.
    99          */
    100         measured_string_ref addr;
    101         /** Actual device hardware address data.
    102          */
    103         char * addr_data;
    104         /** Broadcast device hardware address.
    105          */
    106         measured_string_ref broadcast_addr;
    107         /** Broadcast device hardware address data.
    108          */
    109         char * broadcast_data;
    110         /** Device identifier.
    111          */
     90/** ARP device specific data. */
     91struct arp_device {
     92        /** Actual device hardware address. */
     93        measured_string_t *addr;
     94        /** Actual device hardware address data. */
     95        uint8_t *addr_data;
     96        /** Broadcast device hardware address. */
     97        measured_string_t *broadcast_addr;
     98        /** Broadcast device hardware address data. */
     99        uint8_t *broadcast_data;
     100        /** Device identifier. */
    112101        device_id_t device_id;
    113         /** Hardware type.
    114          */
     102        /** Hardware type. */
    115103        hw_type_t hardware;
    116         /** Packet dimension.
    117          */
     104        /** Packet dimension. */
    118105        packet_dimension_t packet_dimension;
    119         /** Device module phone.
    120          */
     106        /** Device module phone. */
    121107        int phone;
    122         /** Protocol map.
    123          *  Address map for each protocol.
     108       
     109        /**
     110         * Protocol map.
     111         * Address map for each protocol.
    124112         */
    125113        arp_protos_t protos;
    126         /** Device module service.
    127         */
     114       
     115        /** Device module service. */
    128116        services_t service;
    129117};
    130118
    131 /** ARP global data.
    132  */
    133 struct  arp_globals{
    134         /** ARP address cache.
    135          */
     119/** ARP global data. */
     120struct arp_globals {
     121        /** ARP address cache. */
    136122        arp_cache_t cache;
    137         /** The client connection processing function.
    138          *  The module skeleton propagates its own one.
    139          */
    140         async_client_conn_t client_connection;
    141         /** Networking module phone.
    142          */
     123       
     124        /** Networking module phone. */
    143125        int net_phone;
    144         /** Safety lock.
    145          */
    146         fibril_rwlock_t lock;
     126        /** Safety lock. */
     127        fibril_mutex_t lock;
    147128};
    148129
    149 /** ARP protocol specific data.
    150  */
    151 struct arp_proto{
    152         /** Actual device protocol address.
     130/** ARP protocol specific data. */
     131struct arp_proto {
     132        /** Actual device protocol address. */
     133        measured_string_t *addr;
     134        /** Actual device protocol address data. */
     135        uint8_t *addr_data;
     136        /** Address map. */
     137        arp_addr_t addresses;
     138        /** Protocol service. */
     139        services_t service;
     140};
     141
     142/** ARP address translation record. */
     143struct arp_trans {
     144        /**
     145         * Hardware address for the translation. NULL denotes an incomplete
     146         * record with possible waiters.
    153147         */
    154         measured_string_ref addr;
    155         /** Actual device protocol address data.
    156          */
    157         char * addr_data;
    158         /** Address map.
    159          */
    160         arp_addr_t addresses;
    161         /** Protocol service.
    162          */
    163         services_t service;
     148        measured_string_t *hw_addr;
     149        /** Condition variable used for waiting for completion of the record. */
     150        fibril_condvar_t cv;
    164151};
    165152
     
    168155/** @}
    169156 */
     157
Note: See TracChangeset for help on using the changeset viewer.