NETWIB_SHW(3)

NAME
netwib - section shw

HTML DOC
If you have a browser, read netwib-5.39.0-doc_html.tgz which is easier to read than this manpage.

PRESENTATION
This manpage contains a concatenation of includes for section SHW.

MODULE TYPES

MODULE ARRAY
/*-------------------------------------------------------------*/
/***************************************************************
 * An array permits to show a packet. Generally, one line      *
 * corresponds to 32bits/4bytes, as seen in RFCs               *
 ***************************************************************/
/*
For example :
|0|1|1|0|0|1|1|0|0|1|1|0|0|1|1|0|0|1|1|0|0|1|1|0|0|1|1|0|0|1|1|0|
|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|_3_|
|0xF=15_|__0xF__|__15___|0xF=15_|__0xF__|__15___|0xF=15_|__0xF__|
|_0x80=128='c'__|_0x80=128='c'__|_0x80=128='c'__|_0x80=128='c'__|
| data: 0123456789012345678901234567890123456789012345678901234 |
|       0123456789012345678901234567890123456789012345678901234 |
|_______________________________________________________________|
Ethernet________________________________________________________.
| 00:00:01:02:03:04->00:00:05:06:97:08 type:0x0800              |
|_______________________________________________________________|
IP______________________________________________________________.
|version|  ihl  |      tos      |            totlen             |
|___4___|___5___|____0x00=0_____|___________0x0054=84___________|
|              id               |r|D|M|       offsetfrag        |
|___________0x0008=8____________|0|0|0|________0x0000=0_________|
|      ttl      |   protocol    |           checksum            |
|___0xFF=255____|____0x01=1_____|____________0x2551_____________|
|                            source                             |
|_________________________192.168.1.1___________________________|
|                          destination                          |
|_________________________192.168.1.2___________________________|
ICMP4_echo reply________________________________________________.
|     type      |     code      |           checksum            |
|____0x00=0_____|____0x00=0_____|_________0xC6A9=50857__________|
*/
/*-------------------------------------------------------------*/
/* "._________________." or "Title_____________." */
netwib_err netwib_show_array_head(netwib_conststring title,
                                  netwib_buf *pbuf);
/* "|_________________|" */
netwib_err netwib_show_array_tail(netwib_buf *pbuf);
/*-------------------------------------------------------------*/
/* "|" */
netwib_err netwib_show_array_line_begin(netwib_buf *pbuf);
/* "\n" */
netwib_err netwib_show_array_line_end(netwib_buf *pbuf);
/*-------------------------------------------------------------*/
/* centered text surrounded by spaces and ending with "|" */
netwib_err netwib_show_array_text(netwib_uint32 size,
                                  netwib_conststring txt,
                                  netwib_buf *pbuf);
/* num32 is special : line_begin and line_end are internally called */
#define netwib_show_array_text32(text,pbuf) netwib_show_array_text(32,text,pbuf)
#define netwib_show_array_text16(text,pbuf) netwib_show_array_text(16,text,pbuf)
#define netwib_show_array_text8(text,pbuf) netwib_show_array_text(8,text,pbuf)
#define netwib_show_array_text4(text,pbuf) netwib_show_array_text(4,text,pbuf)
#define netwib_show_array_text1(text,pbuf) netwib_show_array_text(1,text,pbuf)
/*-------------------------------------------------------------*/
/* centered number surrounded by "_" and ending with "|" */
typedef enum {
  NETWIB_SHOW_ARRAY_NUMTYPE_BIN = 1,
  NETWIB_SHOW_ARRAY_NUMTYPE_DEC,
  NETWIB_SHOW_ARRAY_NUMTYPE_HEXA,
  NETWIB_SHOW_ARRAY_NUMTYPE_CHAR,
  NETWIB_SHOW_ARRAY_NUMTYPE_DECCHAR,
  NETWIB_SHOW_ARRAY_NUMTYPE_HEXADEC,
  NETWIB_SHOW_ARRAY_NUMTYPE_HEXACHAR,
  NETWIB_SHOW_ARRAY_NUMTYPE_HEXADECCHAR
} netwib_show_array_numtype;
netwib_err netwib_show_array_num(netwib_uint32 size,
                                 netwib_uint32 ui,
                                 netwib_show_array_numtype type,
                                 netwib_buf *pbuf);
/* num32 is special : line_begin and line_end are internally called */
#define netwib_show_array_num32(ui,type,pbuf) netwib_show_array_num(32,ui,type,pbuf)
#define netwib_show_array_num16(ui,type,pbuf) netwib_show_array_num(16,ui,type,pbuf)
#define netwib_show_array_num8(ui,type,pbuf) netwib_show_array_num(8,ui,type,pbuf)
#define netwib_show_array_num4(ui,type,pbuf) netwib_show_array_num(4,ui,type,pbuf)
#define netwib_show_array_num1(ui,pbuf) netwib_show_array_num(1,ui,NETWIB_SHOW_ARRAY_NUMTYPE_DEC,pbuf)
/*-------------------------------------------------------------*/
typedef enum {
  NETWIB_SHOW_ARRAY_ALIGN_LEFT,
  NETWIB_SHOW_ARRAY_ALIGN_CENTER,
  NETWIB_SHOW_ARRAY_ALIGN_RIGHT
} netwib_show_array_align;
/* if size==32, line_begin and line_end are internally called */
netwib_err netwib_show_array_fmt(netwib_uint32 size,
                                 netwib_show_array_align align,
                                 netwib_char fillchar, /* ie ' ' or '_' */
                                 netwib_buf *pbuf,
                                 netwib_conststring fmt,
                                 ...);
/* size==32, align==NETWIB_SHOW_ARRAY_ALIGN_LEFT and fillchar==' ' */
netwib_err netwib_show_array_fmt32(netwib_buf *pbuf,
                                   netwib_conststring fmt,
                                   ...);
/*-------------------------------------------------------------*/
/*
 data wrapped to fit in the array. For example :
    |title: 0123456789012345678901234567890123456789012 |
    |       3456789012345678901234567801234567890123456 |
    |_______567890123456789012345678____________________|
*/
netwib_err netwib_show_array_data(netwib_conststring title,
                                  netwib_constbuf *pdata,
                                  netwib_encodetype encodetype,
                                  netwib_char fillchar, /* ie ' ' or '_' */
                                  netwib_buf *pbuf);

MODULE LINKHDR
/*-------------------------------------------------------------*/
/* Name : netwib_linkhdr_show
   Description :
     Print a netwib_linkhdr.
   Input parameter(s) :
     linkhdr : netwib_linkhdr to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_linkhdr_show(netwib_constlinkhdr *plinkhdr,
                               netwib_encodetype encodetype,
                               netwib_buf *pbuf);

MODULE IPHDR
/*-------------------------------------------------------------*/
/* Name : netwib_iphdr_show
   Description :
     Print a netwib_iphdr.
   Input parameter(s) :
     *piphdr : netwib_iphdr to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_iphdr_show(netwib_constiphdr *piphdr,
                             netwib_encodetype encodetype,
                             netwib_buf *pbuf);

MODULE IP4OPT
/*-------------------------------------------------------------*/
/* Name : netwib_ip4opt_show
   Description :
     Print a netwib_ip4opt.
   Input parameter(s) :
     ip4opt : netwib_ip4opt to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_ip4opt_show(netwib_constip4opt *pip4opt,
                              netwib_encodetype encodetype,
                              netwib_buf *pbuf);

MODULE IP4OPTS
/*-------------------------------------------------------------*/
/* Name : netwib_ip4opts_show
   Description :
     Print a packet containing one or several IP options.
   Input parameter(s) :
     *ppkt : buffer containing physical data
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_ip4opts_show(netwib_constbuf *ppkt,
                               netwib_encodetype encodetype,
                               netwib_buf *pbuf);

MODULE IP6EXT
/*-------------------------------------------------------------*/
/* Name : netwib_ip6ext_show
   Description :
     Print a netwib_ip6ext.
   Input parameter(s) :
     ip6ext : netwib_ip6ext to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_ip6ext_show(netwib_constip6ext *pip6ext,
                              netwib_encodetype encodetype,
                              netwib_buf *pbuf);

MODULE IP6EXTS
/*-------------------------------------------------------------*/
/* Name : netwib_ip6exts_show
   Description :
     Print a packet containing one or several IP options.
   Input parameter(s) :
     pktproto : protocol of the first netwib_ip6ext in ppkt
     *ppkt : buffer containing physical data
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_ip6exts_show(netwib_ipproto pktproto,
                               netwib_constbuf *ppkt,
                               netwib_encodetype encodetype,
                               netwib_buf *pbuf);

MODULE ARPHDR
/*-------------------------------------------------------------*/
/* Name : netwib_arphdr_show
   Description :
     Print a netwib_arphdr.
   Input parameter(s) :
     *parphdr : netwib_arphdr to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_arphdr_show(netwib_constarphdr *parphdr,
                              netwib_encodetype encodetype,
                              netwib_buf *pbuf);

MODULE TCPHDR
/*-------------------------------------------------------------*/
/* Name : netwib_tcphdr_show
   Description :
     Print a netwib_tcphdr.
   Input parameter(s) :
     *ptcphdr : netwib_tcphdr to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_tcphdr_show(netwib_consttcphdr *ptcphdr,
                              netwib_encodetype encodetype,
                              netwib_buf *pbuf);

MODULE UDPHDR
/*-------------------------------------------------------------*/
/* Name : netwib_udphdr_show
   Description :
     Print a netwib_udphdr.
   Input parameter(s) :
     *pudphdr : netwib_udphdr to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_udphdr_show(netwib_constudphdr *pudphdr,
                              netwib_encodetype encodetype,
                              netwib_buf *pbuf);

MODULE TCPOPT
/*-------------------------------------------------------------*/
/* Name : netwib_tcpopt_show
   Description :
     Print a netwib_tcpopt.
   Input parameter(s) :
     tcpopt : netwib_tcpopt to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_tcpopt_show(netwib_consttcpopt *ptcpopt,
                              netwib_encodetype encodetype,
                              netwib_buf *pbuf);

MODULE TCPOPTS
/*-------------------------------------------------------------*/
/* Name : netwib_tcpopts_show
   Description :
     Print a buffer containing one or several TCP option.
   Input parameter(s) :
     *ptcpopts : TCP options to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_tcpopts_show(netwib_constbuf *ptcpopts,
                               netwib_encodetype encodetype,
                               netwib_buf *pbuf);

MODULE ICMP4
/*-------------------------------------------------------------*/
/* Name : netwib_icmp4_show
   Description :
     Print a netwib_icmp4.
   Input parameter(s) :
     *picmp4 : netwib_icmp4 to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_icmp4_show(netwib_consticmp4 *picmp4,
                             netwib_encodetype encodetype,
                             netwib_buf *pbuf);

MODULE ICMP6
/*-------------------------------------------------------------*/
/* Name : netwib_icmp6_show
   Description :
     Print a netwib_icmp6.
   Input parameter(s) :
     *picmp6 : netwib_icmp6 to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_icmp6_show(netwib_consticmp6 *picmp6,
                             netwib_encodetype encodetype,
                             netwib_buf *pbuf);

MODULE ICMP6ND
/*-------------------------------------------------------------*/
/* Name : netwib_icmp6nd_show
   Description :
     Print a netwib_icmp6nd.
   Input parameter(s) :
     icmp6nd : netwib_icmp6nd to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_icmp6nd_show(netwib_consticmp6nd *picmp6nd,
                               netwib_encodetype encodetype,
                               netwib_buf *pbuf);
/*-------------------------------------------------------------*/
/* Name : netwib_icmp6nds_show
   Description :
     Print a packet containing one or several netwib_icmp6nd.
   Input parameter(s) :
     *ppkt : buffer containing physical data
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
     *pbuf : netwib_buf receiving data
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_icmp6nds_show(netwib_constbuf *ppkt,
                                netwib_encodetype encodetype,
                                netwib_buf *pbuf);

MODULE PACKET
/*-------------------------------------------------------------*/
/* Name : netwib_pkt_data_display
   Description :
     Print a buffer containing simple data.
   Input parameter(s) :
     *pkt : buffer to print
     encodetype : netwib_encodetype to use
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_pkt_data_show(netwib_constbuf *ppkt,
                                netwib_encodetype_context *pctx,
                                netwib_encodetype encodetype,
                                netwib_buf *pbuf);
netwib_err netwib_pkt_data_display(netwib_constbuf *ppkt,
                                   netwib_encodetype_context *pctx,
                                   netwib_encodetype encodetype);
/*-------------------------------------------------------------*/
/* Name : netwib_pkt_link_display
   Description :
     Print a buffer containing an Link packet.
   Input parameter(s) :
     *pkt : buffer to print
     hdrencodetype : netwib_encodetype to use for headers
     dataencodetype : netwib_encodetype to use for data
   Input/output parameter(s) :
   Output parameter(s) :
   Normal return values :
     NETWIB_ERR_OK : ok
*/
netwib_err netwib_pkt_link_show(netwib_device_dlttype dlttype,
                                netwib_constbuf *ppkt,
                                netwib_encodetype_context *pctx,
                                netwib_encodetype hdrencodetype,
                                netwib_encodetype dataencodetype,
                                netwib_buf *pbuf);
netwib_err netwib_pkt_link_display(netwib_device_dlttype dlttype,
                                   netwib_constbuf *ppkt,
                                   netwib_encodetype_context *pctx,
                                   netwib_encodetype hdrencodetype,
                                   netwib_encodetype dataencodetype);
/*-------------------------------------------------------------*/
/* Print a buffer containing an IP packet
   Note: currently, IPv6 packets are not decoded, but are simply
         dumped using dataencodetype.
 */
netwib_err netwib_pkt_ip_show(netwib_constbuf *ppkt,
                              netwib_encodetype_context *pctx,
                              netwib_encodetype hdrencodetype,
                              netwib_encodetype dataencodetype,
                              netwib_buf *pbuf);
netwib_err netwib_pkt_ip_display(netwib_constbuf *ppkt,
                                 netwib_encodetype_context *pctx,
                                 netwib_encodetype hdrencodetype,
                                 netwib_encodetype dataencodetype);
/*-------------------------------------------------------------*/
/* Print a buffer containing an UDP packet */
netwib_err netwib_pkt_udp_show(netwib_constbuf *ppkt,
                               netwib_encodetype_context *pctx,
                               netwib_encodetype hdrencodetype,
                               netwib_encodetype dataencodetype,
                               netwib_buf *pbuf);
netwib_err netwib_pkt_udp_display(netwib_constbuf *ppkt,
                                  netwib_encodetype_context *pctx,
                                  netwib_encodetype hdrencodetype,
                                  netwib_encodetype dataencodetype);
/*-------------------------------------------------------------*/
/* Print a buffer containing a TCP packet */
netwib_err netwib_pkt_tcp_show(netwib_constbuf *ppkt,
                               netwib_encodetype_context *pctx,
                               netwib_encodetype hdrencodetype,
                                     netwib_encodetype dataencodetype,
                               netwib_buf *pbuf);
netwib_err netwib_pkt_tcp_display(netwib_constbuf *ppkt,
                                  netwib_encodetype_context *pctx,
                                  netwib_encodetype hdrencodetype,
                                  netwib_encodetype dataencodetype);
/*-------------------------------------------------------------*/
/* Print a buffer containing an ICMP4 packet */
netwib_err netwib_pkt_icmp4_show(netwib_constbuf *ppkt,
                                 netwib_encodetype_context *pctx,
                                 netwib_encodetype hdrencodetype,
                                 netwib_encodetype dataencodetype,
                                 netwib_buf *pbuf);
netwib_err netwib_pkt_icmp4_display(netwib_constbuf *ppkt,
                                    netwib_encodetype_context *pctx,
                                    netwib_encodetype hdrencodetype,
                                    netwib_encodetype dataencodetype);
/*-------------------------------------------------------------*/
/* Print a buffer containing an ICMP6 packet */
netwib_err netwib_pkt_icmp6_show(netwib_constbuf *ppkt,
                                 netwib_encodetype_context *pctx,
                                 netwib_encodetype hdrencodetype,
                                 netwib_encodetype dataencodetype,
                                 netwib_buf *pbuf);
netwib_err netwib_pkt_icmp6_display(netwib_constbuf *ppkt,
                                    netwib_encodetype_context *pctx,
                                    netwib_encodetype hdrencodetype,
                                    netwib_encodetype dataencodetype);

SEE ALSO
netwib(3), netwib_dat(3), netwib_sys(3), netwib_net(3), netwib_pkt(3), netwib_shw(3), netwib_err(3)