Store the portal IP address as a string

Also convert the portal port and the target portal group tag to
unsigned 16 bytes integers.

Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
Fix parsing of IPv6 addresses

In configfs, IPv6 addresses are enclosed with brackets. These brackets
must be removed before the IPv6 address is passed to inet_pton().

Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
Register TPGs and portals using information from configfs

Prior to this patch, the portal port was hardcoded to 3260 and the
portal IP address was set to the client IP address. This commit uses
information from configfs to fill the TPG and portal attributes
instead.

The attributes are registered in a specific order: target, TPGs and
portals. This is described in RFC 4171:

  5.6.5.1. Device Attribute Registration Request (DevAttrReg)

  When an iSCSI Storage Node is registered, the Storage Node attributes
  MAY immediately be followed by a PGT attribute.  The PGT attribute
  SHALL be followed by the set of PG Portal IP-Address, PG TCP/UDP Port
  pairs representing Portal objects that will be associated with the
  Storage Node using the indicated PGT value.  Additional sets of PGTs
  and PG Portal IP-Address PG TCP/UDP Port pairs to be associated with
  the registered Storage Node MAY follow.  Indicated PGT values are
  assigned to the PG object associated with the newly registered iSCSI
  Storage Node and Portal object(s) referenced immediately following
  the PGT attribute in the operating attributes.

Moreover, this patch borrows code from TGT to set the portal IP
address:

  24114a3 Fix isns to handle multiple portals (Andy Grover)

This patch fixes bug #9.

Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>