OpenVAS Scanner  7.0.1~git
byteorder.h File Reference

Unix SMB/CIFS implementation. SMB Byte handling. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CAREFUL_ALIGNMENT   1
 
#define CVAL(buf, pos)   ((unsigned) (((const unsigned char *) (buf))[pos]))
 
#define CVAL_NC(buf, pos)   (((unsigned char *) (buf))[pos]) /* Non-const version of CVAL */
 
#define PVAL(buf, pos)   (CVAL (buf, pos))
 
#define SCVAL(buf, pos, val)   (CVAL_NC (buf, pos) = (val))
 
#define SVAL(buf, pos)   (PVAL (buf, pos) | PVAL (buf, (pos) + 1) << 8)
 
#define IVAL(buf, pos)   (SVAL (buf, pos) | SVAL (buf, (pos) + 2) << 16)
 
#define SSVALX(buf, pos, val)
 
#define SIVALX(buf, pos, val)   (SSVALX (buf, pos, val & 0xFFFF), SSVALX (buf, pos + 2, val >> 16))
 
#define SVALS(buf, pos)   ((int16) SVAL (buf, pos))
 
#define IVALS(buf, pos)   ((int32) IVAL (buf, pos))
 
#define SSVAL(buf, pos, val)   SSVALX ((buf), (pos), ((uint16) (val)))
 
#define SIVAL(buf, pos, val)   SIVALX ((buf), (pos), ((uint32) (val)))
 
#define SSVALS(buf, pos, val)   SSVALX ((buf), (pos), ((int16) (val)))
 
#define SIVALS(buf, pos, val)   SIVALX ((buf), (pos), ((int32) (val)))
 
#define SREV(x)   ((((x) &0xFF) << 8) | (((x) >> 8) & 0xFF))
 
#define IREV(x)   ((SREV (x) << 16) | (SREV ((x) >> 16)))
 
#define RSVAL(buf, pos)   SREV (SVAL (buf, pos))
 
#define RSVALS(buf, pos)   SREV (SVALS (buf, pos))
 
#define RIVAL(buf, pos)   IREV (IVAL (buf, pos))
 
#define RIVALS(buf, pos)   IREV (IVALS (buf, pos))
 
#define RSSVAL(buf, pos, val)   SSVAL (buf, pos, SREV (val))
 
#define RSSVALS(buf, pos, val)   SSVALS (buf, pos, SREV (val))
 
#define RSIVAL(buf, pos, val)   SIVAL (buf, pos, IREV (val))
 
#define RSIVALS(buf, pos, val)   SIVALS (buf, pos, IREV (val))
 
#define ALIGN4(p, base)   ((p) + ((4 - (PTR_DIFF ((p), (base)) & 3)) & 3))
 
#define ALIGN2(p, base)   ((p) + ((2 - (PTR_DIFF ((p), (base)) & 1)) & 1))
 

Detailed Description

Unix SMB/CIFS implementation. SMB Byte handling.

Definition in file byteorder.h.

Macro Definition Documentation

◆ ALIGN2

#define ALIGN2 (   p,
  base 
)    ((p) + ((2 - (PTR_DIFF ((p), (base)) & 1)) & 1))

Definition at line 180 of file byteorder.h.

◆ ALIGN4

#define ALIGN4 (   p,
  base 
)    ((p) + ((4 - (PTR_DIFF ((p), (base)) & 3)) & 3))

Definition at line 179 of file byteorder.h.

◆ CAREFUL_ALIGNMENT

#define CAREFUL_ALIGNMENT   1

Definition at line 109 of file byteorder.h.

◆ CVAL

#define CVAL (   buf,
  pos 
)    ((unsigned) (((const unsigned char *) (buf))[pos]))

Definition at line 112 of file byteorder.h.

◆ CVAL_NC

#define CVAL_NC (   buf,
  pos 
)    (((unsigned char *) (buf))[pos]) /* Non-const version of CVAL */

Definition at line 113 of file byteorder.h.

◆ IREV

#define IREV (   x)    ((SREV (x) << 16) | (SREV ((x) >> 16)))

Definition at line 167 of file byteorder.h.

◆ IVAL

#define IVAL (   buf,
  pos 
)    (SVAL (buf, pos) | SVAL (buf, (pos) + 2) << 16)

Definition at line 121 of file byteorder.h.

◆ IVALS

#define IVALS (   buf,
  pos 
)    ((int32) IVAL (buf, pos))

Definition at line 128 of file byteorder.h.

◆ PVAL

#define PVAL (   buf,
  pos 
)    (CVAL (buf, pos))

Definition at line 115 of file byteorder.h.

◆ RIVAL

#define RIVAL (   buf,
  pos 
)    IREV (IVAL (buf, pos))

Definition at line 171 of file byteorder.h.

◆ RIVALS

#define RIVALS (   buf,
  pos 
)    IREV (IVALS (buf, pos))

Definition at line 172 of file byteorder.h.

◆ RSIVAL

#define RSIVAL (   buf,
  pos,
  val 
)    SIVAL (buf, pos, IREV (val))

Definition at line 175 of file byteorder.h.

◆ RSIVALS

#define RSIVALS (   buf,
  pos,
  val 
)    SIVALS (buf, pos, IREV (val))

Definition at line 176 of file byteorder.h.

◆ RSSVAL

#define RSSVAL (   buf,
  pos,
  val 
)    SSVAL (buf, pos, SREV (val))

Definition at line 173 of file byteorder.h.

◆ RSSVALS

#define RSSVALS (   buf,
  pos,
  val 
)    SSVALS (buf, pos, SREV (val))

Definition at line 174 of file byteorder.h.

◆ RSVAL

#define RSVAL (   buf,
  pos 
)    SREV (SVAL (buf, pos))

Definition at line 169 of file byteorder.h.

◆ RSVALS

#define RSVALS (   buf,
  pos 
)    SREV (SVALS (buf, pos))

Definition at line 170 of file byteorder.h.

◆ SCVAL

#define SCVAL (   buf,
  pos,
  val 
)    (CVAL_NC (buf, pos) = (val))

Definition at line 116 of file byteorder.h.

◆ SIVAL

#define SIVAL (   buf,
  pos,
  val 
)    SIVALX ((buf), (pos), ((uint32) (val)))

Definition at line 130 of file byteorder.h.

◆ SIVALS

#define SIVALS (   buf,
  pos,
  val 
)    SIVALX ((buf), (pos), ((int32) (val)))

Definition at line 132 of file byteorder.h.

◆ SIVALX

#define SIVALX (   buf,
  pos,
  val 
)    (SSVALX (buf, pos, val & 0xFFFF), SSVALX (buf, pos + 2, val >> 16))

Definition at line 125 of file byteorder.h.

◆ SREV

#define SREV (   x)    ((((x) &0xFF) << 8) | (((x) >> 8) & 0xFF))

Definition at line 166 of file byteorder.h.

◆ SSVAL

#define SSVAL (   buf,
  pos,
  val 
)    SSVALX ((buf), (pos), ((uint16) (val)))

Definition at line 129 of file byteorder.h.

◆ SSVALS

#define SSVALS (   buf,
  pos,
  val 
)    SSVALX ((buf), (pos), ((int16) (val)))

Definition at line 131 of file byteorder.h.

◆ SSVALX

#define SSVALX (   buf,
  pos,
  val 
)
Value:
(CVAL_NC (buf, pos) = (unsigned char) ((val) &0xFF), \
CVAL_NC (buf, pos + 1) = (unsigned char) ((val) >> 8))

Definition at line 122 of file byteorder.h.

◆ SVAL

#define SVAL (   buf,
  pos 
)    (PVAL (buf, pos) | PVAL (buf, (pos) + 1) << 8)

Definition at line 120 of file byteorder.h.

◆ SVALS

#define SVALS (   buf,
  pos 
)    ((int16) SVAL (buf, pos))

Definition at line 127 of file byteorder.h.

val
const char * val
Definition: nasl_init.c:378
CVAL_NC
#define CVAL_NC(buf, pos)
Definition: byteorder.h:113