Alexander Aring 818f1f3e70 ipv6: add ipv6_addr_prefix_copy
This patch adds a static inline function ipv6_addr_prefix_copy which
copies a ipv6 address prefix(argument pfx) into the ipv6 address prefix.
The prefix len is given by plen as bits. This function mainly based on
ipv6_addr_prefix which copies one address prefix from address into a new
ipv6 address destination and zero all other address bits.

The difference is that ipv6_addr_prefix_copy don't get a prefix from an
ipv6 address, it sets a prefix to an ipv6 address with keeping other
address bits. The use case is for context based address compression
inside 6LoWPAN IPHC header which keeping ipv6 prefixes inside a context
table to lookup address-bits without sending them.

Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Acked-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-12-10 12:55:28 +01:00
..
2015-12-10 01:25:25 +01:00
2014-09-18 10:54:36 +02:00
2015-03-04 00:23:23 -05:00
2015-06-28 16:55:44 -07:00
2015-11-18 16:17:38 -05:00
2015-03-06 21:50:02 -05:00
2015-09-17 17:18:37 -07:00
2015-12-07 16:35:49 -05:00
2015-10-08 04:27:03 -07:00
2013-11-07 19:28:58 -05:00
2014-09-30 01:02:26 -04:00
2015-09-24 12:25:23 -07:00
2015-11-02 22:47:14 -05:00
2015-12-03 11:32:06 -05:00
2015-09-24 09:34:43 +09:00
2015-12-10 12:55:28 +01:00
2015-10-13 04:55:04 -07:00
2014-01-03 20:56:48 -05:00
2015-10-08 04:27:03 -07:00
2015-10-23 06:26:42 -07:00
2014-06-02 11:00:41 -07:00
2015-03-12 22:58:12 -04:00
2015-10-26 22:24:22 -07:00
2015-10-08 04:27:03 -07:00