Release 4.12 include/net/dsfield.h
/* include/net/dsfield.h - Manipulation of the Differentiated Services field */
/* Written 1998-2000 by Werner Almesberger, EPFL ICA */
#ifndef __NET_DSFIELD_H
#define __NET_DSFIELD_H
#include <linux/types.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <asm/byteorder.h>
static inline __u8 ipv4_get_dsfield(const struct iphdr *iph)
{
return iph->tos;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 17 | 94.44% | 2 | 66.67% |
Jan Engelhardt | 1 | 5.56% | 1 | 33.33% |
Total | 18 | 100.00% | 3 | 100.00% |
static inline __u8 ipv6_get_dsfield(const struct ipv6hdr *ipv6h)
{
return ntohs(*(const __be16 *)ipv6h) >> 4;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 24 | 88.89% | 2 | 50.00% |
Jan Engelhardt | 2 | 7.41% | 1 | 25.00% |
Al Viro | 1 | 3.70% | 1 | 25.00% |
Total | 27 | 100.00% | 4 | 100.00% |
static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask,
__u8 value)
{
__u32 check = ntohs((__force __be16)iph->check);
__u8 dsfield;
dsfield = (iph->tos & mask) | value;
check += iph->tos;
if ((check+1) >> 16) check = (check+1) & 0xffff;
check -= dsfield;
check += check >> 16; /* adjust carry */
iph->check = (__force __sum16)htons(check);
iph->tos = dsfield;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 95 | 92.23% | 2 | 66.67% |
Al Viro | 8 | 7.77% | 1 | 33.33% |
Total | 103 | 100.00% | 3 | 100.00% |
static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask,
__u8 value)
{
__be16 *p = (__force __be16 *)ipv6h;
*p = (*p & htons((((u16)mask << 4) | 0xf00f))) | htons((u16)value << 4);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 42 | 66.67% | 3 | 60.00% |
Hideaki Yoshifuji / 吉藤英明 | 20 | 31.75% | 1 | 20.00% |
Al Viro | 1 | 1.59% | 1 | 20.00% |
Total | 63 | 100.00% | 5 | 100.00% |
#endif
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 200 | 85.84% | 3 | 42.86% |
Hideaki Yoshifuji / 吉藤英明 | 20 | 8.58% | 1 | 14.29% |
Al Viro | 10 | 4.29% | 2 | 28.57% |
Jan Engelhardt | 3 | 1.29% | 1 | 14.29% |
Total | 233 | 100.00% | 7 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.