@@ -213,13 +213,30 @@ impl SimpleNetwork {
213
213
status. to_result_with_val ( || NonNull :: new ( tx_buf. cast ( ) ) )
214
214
}
215
215
216
- /// Place a packet in the transmit queue of a network interface.
216
+ /// Place a packet in the transmit queue of the network interface.
217
+ ///
218
+ /// This depends on the type of network interface. Typically, this takes
219
+ /// ethernet frames and send them over the ethernet network interface.
220
+ ///
221
+ /// The header of the packet is filled by the function with the given
222
+ /// parameters, but the buffer must contain the space for this header.
223
+ ///
224
+ /// # Arguments
225
+ /// - `header_size`: The size in bytes of the media header to be filled by
226
+ /// the transmit() function.
227
+ /// - `buffer`: The buffer containing the whole network packet with all
228
+ /// its payload including the header for the medium.
229
+ /// - `src_addr`: The optional source address.
230
+ /// - `dst_addr`: The optional destination address.
231
+ /// - `protocol`: Ether Type as of RFC 3232. See
232
+ /// https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml#ieee-802-numbers-1
233
+ /// for examples. Typically, this is `0x0800` (IPv4).
217
234
pub fn transmit (
218
235
& self ,
219
236
header_size : usize ,
220
237
buffer : & [ u8 ] ,
221
238
src_addr : Option < MacAddress > ,
222
- dest_addr : Option < MacAddress > ,
239
+ dst_addr : Option < MacAddress > ,
223
240
protocol : Option < u16 > ,
224
241
) -> Result {
225
242
( self . transmit ) (
@@ -228,7 +245,7 @@ impl SimpleNetwork {
228
245
buffer. len ( ) ,
229
246
buffer. as_ptr ( ) . cast ( ) ,
230
247
src_addr. as_ref ( ) ,
231
- dest_addr . as_ref ( ) ,
248
+ dst_addr . as_ref ( ) ,
232
249
protocol. as_ref ( ) ,
233
250
)
234
251
. to_result ( )
0 commit comments