Hi,

These kind of calls could form the basis for the "common case" of packet API. 
Segment API would be needed only when user needs to access other segments. 
Segment API would follow the same logic in usage of 
xxx_addr/_size/_data/_data_len calls (as it current does).

Head/tail of the packet ( i.e. data + data_len) would be modified with specific 
(e.g. push/pull) calls, not by directly setting those.

-Petri


/**
 * Packet buffer start address
 *
 * Returns a pointer to the first byte of the packet buffer. Packet data does
 * not necessarily start from this address. Use other calls e.g.
 * odp_packet_data() or odp_packet_l2() to find pointers into the packet data.
 *
 * In case of a segmented packet, this function refers to the segment which
 * odp_packet_data() currently points to. Other segments need to be accessed
 * through packet segment calls (see odp_packet_seg_xxx()).
 *
 * @param pkt      Packet handle
 *
 * @return Pointer to the packet buffer
 *
 * @see odp_packet_l2(), odp_packet_data(), odp_packet_seg_addr(),
 *      odp_packet_buf_size()
 */
void *odp_packet_buf_addr(odp_packet_t pkt);

/**
 * Packet buffer size
 *
 * Returns packet buffer size in bytes. This is the maximum number of packet
 * data bytes that the packet buffer can hold.
 * 
 * In case of a segmented packet, this function refers to the segment which
 * odp_packet_data() currently points to. Other segments need to be accessed
 * through packet segment calls (see odp_packet_seg_xxx()).
 *
 * @param pkt  Packet handle
 *
 * @return  Packet buffer size in bytes
 *
 * @see odp_packet_buf_addr(), odp_packet_data_len(), odp_packet_seg_size()
 */
size_t odp_packet_buf_size(odp_packet_t pkt);

/**
 * Packet data address
 *
 * Returns a pointer to the first byte of the packet data. When a packet is
 * received from packet input, the data address points to the first byte of the
 * received frame. Later on, the data address can be moved to point some other
 * address within the packet buffer.
 *
 * In case of a segmented packet, this function refers to the segment containing
 * the current data address. Other segments need to be accessed through packet
 * segment calls (see odp_packet_seg_xxx()).
 *
 * @param pkt  Packet handle
 *
 * @return  Pointer to the packet data
 *
 * @see odp_packet_data_len(), odp_packet_buf_addr(), odp_packet_seg_data()
 */
void *odp_packet_data(odp_packet_t pkt);

/**
 * Packet data length
 *
 * Returns the current packet data length in bytes. The length includes
 * ethernet CRC bytes when those are part of packet data. 
 * 
 * In case of a segmented packet, this function refers to the data length of the
 * segment which odp_packet_data() currently points to. Other segments need to
 * be accessed through packet segment calls (see odp_packet_seg_xxx()).
 *
 * @param pkt  Packet handle
 *
 * @return  Packet data length in bytes
 *
 * @see odp_packet_data(), odp_packet_total_len(), odp_packet_buf_size()
 */
size_t odp_packet_data_len(odp_packet_t pkt);

/**
 * Total packet data length
 *
 * Returns the total packet data length in bytes. Total length includes all
 * packet bytes over all segments. The length includes ethernet CRC bytes when
 * those are part of packet data.
 *
 * @param pkt  Packet handle
 *
 * @return  Total packet data length in bytes
 *
 * @see odp_packet_data_len(), odp_packet_buf_size()
 */
size_t odp_packet_total_len(odp_packet_t pkt);



_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to