kohler/click — pull request #121 by kwi-dk (2014-04-22 09:42:20+00:00)
Title: Resize and CopyData elements

Hi,

I'm submitting these two general-purpose elements for inclusion in the "standard" group. They're useful when doing ad-hoc protocol implementations in Click "soft code".

The first is a more generic version of `Strip`/`Unstrip`, which also adds/removes data at the end of the packet.

```
Resize(HEAD, TAIL) - adjust packet length.

Adds HEAD bytes in front of packet and TAIL bytes at the end of the packet. If either
number is negative, bytes are removed instead of added.
```

The second is able to copy data between packets or within a packet.

```
CopyData(RANGE_1, ..., RANGE_N) - copies data from one packet to another.

When CopyData receives a packet on input 0, it copies the selected bytes to its "clipboard",
and emits the packet unchanged on output 0. When receiving a packet on input 1, CopyData
updates the packet with the bytes from the clipboard, and outputs the modified packet on
output 1. This way, data from a single packet can be copied to 0 or more other packets.
```