[英语单词] tuple 元组

当然对于元组的理解,需要考虑上下文比如:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/linux-traffic-control_configuring-and-managing-networking

这个链接里的这一句话里的tuple,是指的packet专有的tuple,源地址,目的地址,源port,目的port。这就需要做记忆。尤其是作为唯一标识的tuple。
The connection tracking entry stores a Netfilter mark and tracks the connection state information in the memory table in which a new packet tuple maps with an existing entry.


/* A `tuple' is a structure containing the information to uniquely
  identify a connection.  ie. if two packets have the same tuple, they
  are in the same connection; if not, they are not.

  We divide the structure along "manipulatable" and
  "non-manipulatable" lines, for the benefit of the NAT code.
*/

/* This contains the information to distinguish a connection. */
struct nf_conntrack_tuple {
    
    
	struct nf_conntrack_man src;

	/* These are the parts of the tuple which are fixed. */
	struct {
    
    
		union nf_inet_addr u3;
		union {
    
    
			/* Add other protocols here. */
			__be16 all;

			struct {
    
    
				__be16 port;
			} tcp;
			struct {
    
    
				__be16 port;
			} udp;
			struct {
    
    
				u_int8_t type, code;
			} icmp;
			struct {
    
    
				__be16 port;
			} dccp;
			struct {
    
    
				__be16 port;
			} sctp;
			struct {
    
    
				__be16 key;
			} gre;
		} u;

		/* The protocol. */
		u_int8_t protonum;

		/* The direction (for tuplehash) */
		u_int8_t dir;
	} dst;
};

Guess you like

Origin blog.csdn.net/qq_36428903/article/details/132846004