OSDN Git Service

Update releases for LDP 3.67
[linuxjm/LDP_man-pages.git] / release / man7 / packet.7
index 8cdd527..a0efab6 100644 (file)
@@ -202,26 +202,19 @@ continued.
 この整数オプションを設定すると、パケットの前に追加で領域が予約される。
 .TP 
 \fBPACKET_RX_RING\fP
-Create a memory\-mapped ring buffer for asynchronous packet reception.  The
-packet socket reserves a contiguous region of application address space,
-lays it out into an array of packet slots and copies packets (up to
-\fItp_snaplen\fP)  into subsequent slots.  Each packet is preceded by a
-metadata structure similar to \fItpacket_auxdata\fP.  The protocol fields
-encode the offset to the data from the start of the metadata header.
-\fItp_net\fP stores the offset to the network layer.  If the packet socket is
-of type \fBSOCK_DGRAM\fP, then \fItp_mac\fP is the same.  If it is of type
-\fBSOCK_RAW\fP, then that field stores the offset to the link\-layer frame.
-Packet socket and application communicate the head and tail of the ring
-through the \fItp_status\fP field.  The packet socket owns all slots with
-\fItp_status\fP equal to \fBTP_STATUS_KERNEL\fP.  After filling a slot, it changes
-the status of the slot to transfer ownership to the application.  During
-normal operation, the new \fItp_status\fP value has at least the
-\fBTP_STATUS_USER\fP bit set to signal that a received packet has been stored.
-When the application has finished processing a packet, it transfers
-ownership of the slot back to the socket by setting \fItp_status\fP equal to
-\fBTP_STATUS_KERNEL\fP.  Packet sockets implement multiple variants of the
-packet ring.  The implementation details are described in
-\fIDocumentation/networking/packet_mmap.txt\fP in the Linux kernel source tree.
+非同期でのパケット受信用のメモリマップされたリングバッファを作成する。 パケットソケットはアプリケーションのアドレス空間に連続する領域を確保し、
+そこにパケットスロットの配列を構成し、 (最大 \fItp_snaplen\fP 個の) パケットを順にスロットにコピーする。 各パケットの前には
+\fItpacket_auxdata\fP に似たメタデータ構造体が置かれる。
+プロトコルフィールドには、データの、メタデータヘッダーの先頭からのオフセットが入る。 \fItp_net\fP にはネットワーク層へのオフセットが格納される。
+パケットソケットが \fBSOCK_DGRAM\fP 型の場合、 \fItp_mac\fP も同じである。 \fBSOCK_RAW\fP 型の場合、 \fItp_net\fP
+にはリンク層のフレームへのオフセットが入る。 パケットソケットとアプリケーションは \fItp_status\fP フィールドを通してリングの先頭
+(head) と末尾 (tail) の情報を受け渡す。 パケットソケットは \fItp_status\fP が \fBTP_STATUS_KERNEL\fP
+のすべてのスロットを所有しており、 スロットにデータが入ると、
+パケットソケットはそのスロットのステータスをアプリケーションに所有権を渡す状態に変更する。 通常の動作では、 新しい \fItp_status\fP
+で少なくとも \fBTP_STATUS_USER\fP ビットがセットされていれば、 受信されたパケットが格納されたことを示している。
+アプリケーションがパケットの処理を終えると、アプリケーションはそのスロットの \fBtp_status\fP を \fBTP_STATUS_KERNEL\fP
+に設定し、そのスロットの所有権をソケットに返す。 パケットソケットは、複数バージョンのパケットリングを実装している。 実装の詳細は Linux
+カーネルソースツリーの \fIDocumentation/networking/packet_mmap.txt\fP で説明されている。
 .TP 
 \fBPACKET_STATISTICS\fP
 パケットソケットの統計情報を次の構造体形式で取得する。
@@ -247,16 +240,14 @@ struct tpacket_stats {
 .TP 
 \fBPACKET_TX_RING\fP (Linux 2.6.31 以降)
 .\" commit 69e3c75f4d541a6eb151b3ef91f34033cb3ad6e1
-Create a memory\-mapped ring buffer for packet transmission.  This option is
-similar to \fBPACKET_RX_RING\fP and takes the same arguments.  The application
-writes packets into slots with \fItp_status\fP equal to \fBTP_STATUS_AVAILABLE\fP
-and schedules them for transmission by changing \fItp_status\fP to
-\fBTP_STATUS_SEND_REQUEST\fP.  When packets are ready to be transmitted, the
-application calls \fBsend\fP(2)  or a variant thereof.  The \fIbuf\fP and \fIlen\fP
-fields of this call are ignored.  If an address is passed using \fBsendto\fP(2)
-or \fBsendmsg\fP(2), then that overrides the socket default.  On successful
-transmission, the socket resets \fItp_status\fP to \fBTP_STATUS_AVAILABLE\fP.  It
-immediately aborts the transmission on error unless \fBPACKET_LOSS\fP is set.
+パケット送信用のメモリマップされたリングバッファを作成する。 このオプションは \fBPACKET_RX_RING\fP と同様で、同じ引き数を取る。
+アプリケーションは \fItp_status\fP が \fBTP_STATUS_AVAILABLE\fP のスロットにパケットを書き込み、
+\fItp_status\fP を \fBTP_STATUS_SEND_REQUEST\fP に変更することでそのパケットの送信を予約する。
+パケットの送信準備ができたら、アプリケーションは続けて \fBsend\fP(2) 系のシステムコールを呼び出す。 システムコールの引き数 \fIbuf\fP と
+\fIlen\fP は無視される。 \fBsendto\fP(2) や \fBsendmsg\fP(2) を使ってアドレスが渡された場合、
+ソケットのデフォルト値ではなくそのアドレスが使用される。 送信に成功すると、ソケットはそのスロットの \fItp_status\fP を
+\fBTP_STATUS_AVAILABLE\fP に戻す。 エラーの場合、 \fBPACKET_LOSS\fP がセットされていなければ、
+直ちに送信を中断しエラーを上げる。
 .TP 
 \fBPACKET_VERSION\fP (\fBPACKET_RX_RING\fP で使用; Linux 2.6.27 以降)
 .\" commit bbd6ef87c544d88c30e4b762b1b61ef267a7d279