Subversion Repositories HelenOS

Rev

Rev 4695 | Rev 4708 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4695 Rev 4702
Line 79... Line 79...
79
 *  @returns EOK on success.
79
 *  @returns EOK on success.
80
 *  @returns ENOMEM if there is not enough memory left.
80
 *  @returns ENOMEM if there is not enough memory left.
81
 */
81
 */
82
int arp_proto_create( arp_proto_ref * proto, services_t service, measured_string_ref address );
82
int arp_proto_create( arp_proto_ref * proto, services_t service, measured_string_ref address );
83
 
83
 
-
 
84
/** Clears the device specific data.
-
 
85
 *  @param device The device specific data.
-
 
86
 */
-
 
87
void    clear_device( arp_device_ref device );
-
 
88
 
-
 
89
/** @name Message processing functions
-
 
90
 */
-
 
91
/*@{*/
-
 
92
 
84
/** Registers the device.
93
/** Registers the device.
85
 *  Creates new device entry in the cache or updates the protocol address if the device with the device identifier and the driver service exists.
94
 *  Creates new device entry in the cache or updates the protocol address if the device with the device identifier and the driver service exists.
86
 *  @param device_id The device identifier. Input parameter.
95
 *  @param device_id The device identifier. Input parameter.
87
 *  @param service The device driver service. Input parameter.
96
 *  @param service The device driver service. Input parameter.
88
 *  @param protocol The protocol service. Input parameter.
97
 *  @param protocol The protocol service. Input parameter.
Line 112... Line 121...
112
 *  Responses to the ARP request if the packet is the ARP request and is targeted to my address.
121
 *  Responses to the ARP request if the packet is the ARP request and is targeted to my address.
113
 *  @param device_id The source device identifier. Input parameter.
122
 *  @param device_id The source device identifier. Input parameter.
114
 *  @param packet The received packet. Input/output parameter.
123
 *  @param packet The received packet. Input/output parameter.
115
 *  @returns EOK on success and the packet is no longer needed.
124
 *  @returns EOK on success and the packet is no longer needed.
116
 *  @returns 1 on success and the packet has been reused.
125
 *  @returns 1 on success and the packet has been reused.
117
 *  @returns EINVAL if the packet is too small to carry the ARP packet.
126
 *  @returns EINVAL if the packet is too small to carry an ARP packet.
118
 *  @returns EINVAL if the received address lengths differs from the registered values.
127
 *  @returns EINVAL if the received address lengths differs from the registered values.
119
 *  @returns ENOENT if the device is not found in the cache.
128
 *  @returns ENOENT if the device is not found in the cache.
120
 *  @returns ENOENT if the protocol for the device is not found in the cache.
129
 *  @returns ENOENT if the protocol for the device is not found in the cache.
121
 *  @returns ENOMEM if there is not enough memory left.
130
 *  @returns ENOMEM if there is not enough memory left.
122
 */
131
 */
123
int arp_receive_message( device_id_t device_id, packet_t packet );
132
int arp_receive_message( device_id_t device_id, packet_t packet );
124
 
133
 
125
/** Clears the device specific data.
-
 
126
 *  @param device The device specific data.
-
 
127
 */
-
 
128
void    clear_device( arp_device_ref device );
-
 
129
 
-
 
130
/** Updates the device content length according to the new MTU value.
134
/** Updates the device content length according to the new MTU value.
131
 *  @param device_id The device identifier. Input parameter.
135
 *  @param device_id The device identifier. Input parameter.
132
 *  @param mtu The new mtu value. Input parameter.
136
 *  @param mtu The new mtu value. Input parameter.
-
 
137
 *  @returns ENOENT if device is not found.
133
 *  @returns EOK on success.
138
 *  @returns EOK on success.
134
 */
139
 */
135
int arp_mtu_changed_msg( device_id_t device_id, size_t mtu );
140
int arp_mtu_changed_message( device_id_t device_id, size_t mtu );
-
 
141
 
-
 
142
/*@}*/
136
 
143
 
137
DEVICE_MAP_IMPLEMENT( arp_cache, arp_device_t )
144
DEVICE_MAP_IMPLEMENT( arp_cache, arp_device_t )
138
 
145
 
139
INT_MAP_IMPLEMENT( arp_protos, arp_proto_t )
146
INT_MAP_IMPLEMENT( arp_protos, arp_proto_t )
140
 
147
 
Line 490... Line 497...
490
 
497
 
491
int arp_connect_module( services_t service ){
498
int arp_connect_module( services_t service ){
492
    return EOK;
499
    return EOK;
493
}
500
}
494
 
501
 
495
int arp_mtu_changed_msg( device_id_t device_id, size_t mtu ){
502
int arp_mtu_changed_message( device_id_t device_id, size_t mtu ){
496
    arp_device_ref  device;
503
    arp_device_ref  device;
497
 
504
 
498
    fibril_rwlock_write_lock( & arp_globals.lock );
505
    fibril_rwlock_write_lock( & arp_globals.lock );
499
    device = arp_cache_find( & arp_globals.cache, device_id );
506
    device = arp_cache_find( & arp_globals.cache, device_id );
500
    if( ! device ){
507
    if( ! device ){
Line 565... Line 572...
565
                }while( packet );
572
                }while( packet );
566
                fibril_rwlock_read_unlock( & arp_globals.lock );
573
                fibril_rwlock_read_unlock( & arp_globals.lock );
567
            }
574
            }
568
            return ERROR_CODE;
575
            return ERROR_CODE;
569
        case NET_IL_MTU_CHANGED:
576
        case NET_IL_MTU_CHANGED:
570
            return arp_mtu_changed_msg( IPC_GET_DEVICE( call ), IPC_GET_MTU( call ));
577
            return arp_mtu_changed_message( IPC_GET_DEVICE( call ), IPC_GET_MTU( call ));
571
    }
578
    }
572
    return ENOTSUP;
579
    return ENOTSUP;
573
}
580
}
574
 
581
 
575
/** @}
582
/** @}