Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
utils.c File Reference
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/inet.h>
#include <linux/mm.h>
#include <linux/net.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/percpu.h>
#include <linux/init.h>
#include <linux/ratelimit.h>
#include <net/sock.h>
#include <net/net_ratelimit.h>
#include <asm/byteorder.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define IN6PTON_XDIGIT   0x00010000
 
#define IN6PTON_DIGIT   0x00020000
 
#define IN6PTON_COLON_MASK   0x00700000
 
#define IN6PTON_COLON_1   0x00100000 /* single : requested */
 
#define IN6PTON_COLON_2   0x00200000 /* second : requested */
 
#define IN6PTON_COLON_1_2   0x00400000 /* :: requested */
 
#define IN6PTON_DOT   0x00800000 /* . */
 
#define IN6PTON_DELIM   0x10000000
 
#define IN6PTON_NULL   0x20000000 /* first/tail */
 
#define IN6PTON_UNKNOWN   0x40000000
 

Functions

 EXPORT_SYMBOL (net_msg_warn)
 
 DEFINE_RATELIMIT_STATE (net_ratelimit_state, 5 *HZ, 10)
 
int net_ratelimit (void)
 
 EXPORT_SYMBOL (net_ratelimit)
 
__be32 in_aton (const char *str)
 
 EXPORT_SYMBOL (in_aton)
 
int in4_pton (const char *src, int srclen, u8 *dst, int delim, const char **end)
 
 EXPORT_SYMBOL (in4_pton)
 
int in6_pton (const char *src, int srclen, u8 *dst, int delim, const char **end)
 
 EXPORT_SYMBOL (in6_pton)
 
void inet_proto_csum_replace4 (__sum16 *sum, struct sk_buff *skb, __be32 from, __be32 to, int pseudohdr)
 
 EXPORT_SYMBOL (inet_proto_csum_replace4)
 
void inet_proto_csum_replace16 (__sum16 *sum, struct sk_buff *skb, const __be32 *from, const __be32 *to, int pseudohdr)
 
 EXPORT_SYMBOL (inet_proto_csum_replace16)
 
int mac_pton (const char *s, u8 *mac)
 
 EXPORT_SYMBOL (mac_pton)
 

Variables

int net_msg_warn __read_mostly = 1
 

Macro Definition Documentation

#define IN6PTON_COLON_1   0x00100000 /* single : requested */

Definition at line 82 of file utils.c.

#define IN6PTON_COLON_1_2   0x00400000 /* :: requested */

Definition at line 84 of file utils.c.

#define IN6PTON_COLON_2   0x00200000 /* second : requested */

Definition at line 83 of file utils.c.

#define IN6PTON_COLON_MASK   0x00700000

Definition at line 81 of file utils.c.

#define IN6PTON_DELIM   0x10000000

Definition at line 86 of file utils.c.

#define IN6PTON_DIGIT   0x00020000

Definition at line 80 of file utils.c.

#define IN6PTON_DOT   0x00800000 /* . */

Definition at line 85 of file utils.c.

#define IN6PTON_NULL   0x20000000 /* first/tail */

Definition at line 87 of file utils.c.

#define IN6PTON_UNKNOWN   0x40000000

Definition at line 88 of file utils.c.

#define IN6PTON_XDIGIT   0x00010000

Definition at line 79 of file utils.c.

Function Documentation

DEFINE_RATELIMIT_STATE ( net_ratelimit_state  ,
5 *  HZ,
10   
)
EXPORT_SYMBOL ( net_msg_warn  )
EXPORT_SYMBOL ( net_ratelimit  )
EXPORT_SYMBOL ( in_aton  )
EXPORT_SYMBOL ( in4_pton  )
EXPORT_SYMBOL ( in6_pton  )
EXPORT_SYMBOL ( inet_proto_csum_replace4  )
EXPORT_SYMBOL ( inet_proto_csum_replace16  )
EXPORT_SYMBOL ( mac_pton  )
int in4_pton ( const char src,
int  srclen,
u8 dst,
int  delim,
const char **  end 
)

in4_pton - convert an IPv4 address from literal to binary representation : the start of the IPv4 address string : the length of the string, -1 means strlen(src) : the binary (u8[4] array) representation of the IPv4 address : the delimiter of the IPv4 address in , -1 means no delimiter : A pointer to the end of the parsed string will be placed here

Return one on success, return zero when any error occurs and will point to the end of the parsed string.

Definition at line 122 of file utils.c.

int in6_pton ( const char src,
int  srclen,
u8 dst,
int  delim,
const char **  end 
)

in6_pton - convert an IPv6 address from literal to binary representation : the start of the IPv6 address string : the length of the string, -1 means strlen(src) : the binary (u8[16] array) representation of the IPv6 address : the delimiter of the IPv6 address in , -1 means no delimiter : A pointer to the end of the parsed string will be placed here

Return one on success, return zero when any error occurs and will point to the end of the parsed string.

Definition at line 188 of file utils.c.

__be32 in_aton ( const char str)

Definition at line 54 of file utils.c.

void inet_proto_csum_replace16 ( __sum16 sum,
struct sk_buff skb,
const __be32 from,
const __be32 to,
int  pseudohdr 
)

Definition at line 321 of file utils.c.

void inet_proto_csum_replace4 ( __sum16 sum,
struct sk_buff skb,
__be32  from,
__be32  to,
int  pseudohdr 
)

Definition at line 305 of file utils.c.

int mac_pton ( const char s,
u8 mac 
)

Definition at line 341 of file utils.c.

int net_ratelimit ( void  )

Definition at line 42 of file utils.c.

Variable Documentation

int net_msg_warn __read_mostly = 1

Definition at line 35 of file utils.c.