mirror of
https://github.com/szehl/ath9k-hmac.git
synced 2025-02-12 21:35:23 +00:00
26 lines
471 B
C
26 lines
471 B
C
#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 */
|