All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: Partial IP4 syntax
@ 2004-09-29  1:41 Simon Lodal
  2004-09-29  3:56 ` Ben Efros
  2004-09-29  8:50 ` Henrik Nordstrom
  0 siblings, 2 replies; 15+ messages in thread
From: Simon Lodal @ 2004-09-29  1:41 UTC (permalink / raw)
  To: netfilter-devel


While writing yet another IP4 address parser I came up with an idea for 
a more compact IP address/mask notation, to make stuff simpler to write 
and read.

The idea is to just leave out irrelevant octets. There are 3 forms of 
partial addresses:
1) .b.c.d | .c.d | .d (leading dot): Incomplete at beginning.
2) a..d | a..c.d | a.b..d (double dot): Incomplete in the middle.
3) a | a. | a.b | a.b. | a.b.c | a.b.c. (trailing dot or missing 
octets): Incomplete at end.

In each case the position and number of missing octets can be deduced 
and zeroes inserted for them. The parser then calculates a default mask 
which only covers the octets that were defined.

Examples:
10 = 10.0.0.0/8
10. = 10.0.0.0/8
10.0 = 10.0.0.0/16
10.0. = 10.0.0.0/16
.4 = 0.0.0.4/0.0.0.255
.3.4 = 0.0.3.4/0.0.255.255
1..4 = 1.0.0.4/255.0.0.255
.2.3. = invalid, can only be incomplete at one end

I know IP address syntax should not change every day. But this will not 
break or exclude old syntax. I do not see it clashing with other/future 
syntax.

Only minor problem I know of is when parsing netmask which can be in 
cidr or dotted quad form: /32 could be interpreted as a partial address, 
expanded to 32.0.0.0. But it is simple to special case this; make it a 
cidr mask when there is only one octet and it is <=32, otherwise 
interpret as dotted quad (partial or not).

What do you think? Old hat?


Simon

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-09-29 22:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-29  1:41 RFC: Partial IP4 syntax Simon Lodal
2004-09-29  3:56 ` Ben Efros
2004-09-29  5:42   ` Simon Lodal
2004-09-29  8:55     ` Henrik Nordstrom
2004-09-29 16:38       ` Simon Lodal
2004-09-29 17:05         ` Henrik Nordstrom
2004-09-29 18:45           ` Simon Lodal
2004-09-29 19:11             ` Cedric Blancher
2004-09-29 22:41               ` Simon Lodal
2004-09-29 19:39             ` Henrik Nordstrom
2004-09-29  8:50 ` Henrik Nordstrom
2004-09-29 16:37   ` Simon Lodal
2004-09-29 16:54     ` Henrik Nordstrom
2004-09-29 18:21       ` Simon Lodal
2004-09-29 19:30         ` Henrik Nordstrom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.