Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/ip/ip.h

    re526f08 r88a1bb9  
    2828
    2929/** @addtogroup ip
    30  *  @{
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  IP module.
     34 * IP module.
    3535 */
    3636
    37 #ifndef __NET_IP_H__
    38 #define __NET_IP_H__
     37#ifndef NET_IP_H_
     38#define NET_IP_H_
    3939
    4040#include <fibril_synch.h>
     
    5050
    5151/** Type definition of the IP global data.
    52  *  @see ip_globals
     52 * @see ip_globals
    5353 */
    54 typedef struct ip_globals       ip_globals_t;
     54typedef struct ip_globals ip_globals_t;
    5555
    5656/** Type definition of the IP network interface specific data.
    57  *  @see ip_netif
     57 * @see ip_netif
    5858 */
    59 typedef struct ip_netif ip_netif_t;
    60 
    61 /** Type definition of the IP network interface specific data pointer.
    62  *  @see ip_netif
    63  */
    64 typedef ip_netif_t *    ip_netif_ref;
     59typedef struct ip_netif ip_netif_t;
    6560
    6661/** Type definition of the IP protocol specific data.
    67  *  @see ip_proto
     62 * @see ip_proto
    6863 */
    69 typedef struct ip_proto ip_proto_t;
    70 
    71 /** Type definition of the IP protocol specific data pointer.
    72  *  @see ip_proto
    73  */
    74 typedef ip_proto_t *    ip_proto_ref;
     64typedef struct ip_proto ip_proto_t;
    7565
    7666/** Type definition of the IP route specific data.
     
    7969typedef struct ip_route ip_route_t;
    8070
    81 /** Type definition of the IP route specific data pointer.
    82  *  @see ip_route
     71/** IP network interfaces.
     72 * Maps devices to the IP network interface specific data.
     73 * @see device.h
    8374 */
    84 typedef ip_route_t *    ip_route_ref;
    85 
    86 /** IP network interfaces.
    87  *  Maps devices to the IP network interface specific data.
    88  *  @see device.h
    89  */
    90 DEVICE_MAP_DECLARE(ip_netifs, ip_netif_t)
     75DEVICE_MAP_DECLARE(ip_netifs, ip_netif_t);
    9176
    9277/** IP registered protocols.
    93  *  Maps protocols to the IP protocol specific data.
    94  *  @see int_map.h
     78 * Maps protocols to the IP protocol specific data.
     79 * @see int_map.h
    9580 */
    96 INT_MAP_DECLARE(ip_protos, ip_proto_t)
     81INT_MAP_DECLARE(ip_protos, ip_proto_t);
    9782
    9883/** IP routing table.
    99  *  @see generic_field.h
     84 * @see generic_field.h
    10085 */
    101 GENERIC_FIELD_DECLARE(ip_routes, ip_route_t)
     86GENERIC_FIELD_DECLARE(ip_routes, ip_route_t);
    10287
    103 /** IP network interface specific data.
    104  */
    105 struct  ip_netif{
    106         /** ARP module.
    107          *  Assigned if using ARP.
    108          */
    109         module_ref arp;
    110         /** Broadcast address.
    111          */
     88/** IP network interface specific data. */
     89struct ip_netif {
     90        /** ARP module. Assigned if using ARP. */
     91        module_t *arp;
     92        /** Broadcast address. */
    11293        in_addr_t broadcast;
    113         /** Device identifier.
    114          */
     94        /** Device identifier. */
    11595        device_id_t device_id;
    116         /** Indicates whether using DHCP.
    117          */
     96        /** Indicates whether using DHCP. */
    11897        int dhcp;
    119         /** IP version.
    120          */
     98        /** IP version. */
    12199        int ipv;
    122         /** Packet dimension.
    123          */
     100        /** Packet dimension. */
    124101        packet_dimension_t packet_dimension;
    125         /** Netif module phone.
    126          */
     102        /** Netif module phone. */
    127103        int phone;
    128         /** Routing table.
    129          */
     104        /** Routing table. */
    130105        ip_routes_t routes;
    131         /** Indicates whether IP routing is enabled.
    132          */
     106        /** Indicates whether IP routing is enabled. */
    133107        int routing;
    134         /** Netif module service.
    135          */
     108        /** Netif module service. */
    136109        services_t service;
    137         /** Device state.
    138          */
     110        /** Device state. */
    139111        device_state_t state;
    140112};
    141113
    142 /** IP protocol specific data.
    143  */
    144 struct ip_proto{
    145         /** Protocol module phone.
    146          */
     114/** IP protocol specific data. */
     115struct ip_proto {
     116        /** Protocol module phone. */
    147117        int phone;
    148         /** Protocol number.
    149          */
     118        /** Protocol number. */
    150119        int protocol;
    151         /** Protocol packet receiving function.
    152          */
     120        /** Protocol packet receiving function. */
    153121        tl_received_msg_t received_msg;
    154         /** Protocol module service.
    155          */
     122        /** Protocol module service. */
    156123        services_t service;
    157124};
    158125
    159 /** IP route specific data.
    160  */
    161 struct ip_route{
    162         /** Target address.
    163          */
     126/** IP route specific data. */
     127struct ip_route {
     128        /** Target address. */
    164129        in_addr_t address;
    165         /** Gateway.
    166          */
     130        /** Gateway. */
    167131        in_addr_t gateway;
    168         /** Parent netif.
    169          */
    170         ip_netif_ref netif;
    171         /** Target network mask.
    172          */
     132        /** Parent netif. */
     133        ip_netif_t *netif;
     134        /** Target network mask. */
    173135        in_addr_t netmask;
    174136};
    175137
    176 /** IP global data.
    177  */
    178 struct  ip_globals{
    179         /** Default client connection function for support modules.
    180          */
     138/** IP global data. */
     139struct ip_globals {
     140        /** Default client connection function for support modules. */
    181141        async_client_conn_t client_connection;
    182         /** Default gateway.
    183          */
     142        /** Default gateway. */
    184143        ip_route_t gateway;
    185         /** Safety lock.
    186          */
     144        /** Safety lock. */
    187145        fibril_rwlock_t lock;
    188         /** Known support modules.
    189          */
     146        /** Known support modules. */
    190147        modules_t modules;
    191         /** Networking module phone.
    192          */
     148        /** Networking module phone. */
    193149        int net_phone;
    194         /** Registered network interfaces.
    195          */
     150        /** Registered network interfaces. */
    196151        ip_netifs_t netifs;
    197         /** Netifs safeyt lock.
    198          */
     152        /** Netifs safeyt lock. */
    199153        fibril_rwlock_t netifs_lock;
    200         /** Packet counter.
    201          */
     154        /** Packet counter. */
    202155        uint16_t packet_counter;
    203         /** Registered protocols.
    204          */
     156        /** Registered protocols. */
    205157        ip_protos_t protos;
    206         /** Protocols safety lock.
    207          */
     158        /** Protocols safety lock. */
    208159        fibril_rwlock_t protos_lock;
    209160};
Note: See TracChangeset for help on using the changeset viewer.