|
Last change
on this file was
2,
checked in by phkim, 11 years ago
|
|
1.phkim
- revision copy newcon3sk r27
|
-
Property svn:executable set to
*
|
|
File size:
355 bytes
|
| Rev | Line | |
|---|
| [2] | 1 | #ifndef _LINUX_INETDEVICE_H |
|---|
| 2 | #define _LINUX_INETDEVICE_H |
|---|
| 3 | |
|---|
| 4 | #include <asm/types.h> |
|---|
| 5 | |
|---|
| 6 | static __inline__ __u32 inet_make_mask(int logmask) |
|---|
| 7 | { |
|---|
| 8 | if (logmask) |
|---|
| 9 | return htonl(~((1<<(32-logmask))-1)); |
|---|
| 10 | return 0; |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | static __inline__ int inet_mask_len(__u32 mask) |
|---|
| 14 | { |
|---|
| 15 | if (!(mask = ntohl(mask))) |
|---|
| 16 | return 0; |
|---|
| 17 | return 32 - ffz(~mask); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | #endif /* _LINUX_INETDEVICE_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.