blob: 1fcc384055880b3f252da6a28b0236a7f1c686c8 [file] [log] [blame]
#ifndef __BACKPORT_IN_H
#define __BACKPORT_IN_H
#include_next <linux/in.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
static inline int proto_ports_offset(int proto)
{
switch (proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
case IPPROTO_DCCP:
case IPPROTO_ESP: /* SPI */
case IPPROTO_SCTP:
case IPPROTO_UDPLITE:
return 0;
case IPPROTO_AH: /* SPI */
return 4;
default:
return -EINVAL;
}
}
#endif
#endif /* __BACKPORT_IN_H */