[insert project logo here (125x200px max)]

Navigator

Mailinglists

Please report any errors or ommissions you find to our `Help' mailinglist, or post a message in the Forums.

Copyright and Licensing Information

Snap is (c) Jonathan T. Moore, 1999-2002 and licensed under the GNU General Public License (GPL).

All other parts of Splash are (c) Willem de Bruijn, 2002-2003 and licensed under the BSD Open Source License.

All sourcecode is made publicly available.

Acknowledgement

Splash and the Splash website are hosted by SourceForge.net

SourceForge.net Logo

osi-open source certified logo

Splash - Documentation

SNMP Plus a Lightweight API for SNAP Handling

Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

snap-1.1-wjdb/lib/snap_bytecode.c File Reference

#include <stdlib.h>
#include <ctype.h>
#include <netinet/in.h>
#include <stdio.h>
#include "bytecode.h"
#include "dyncheck.h"
#include "wassert.h"
#include "packet.h"

Include dependency graph for snap_bytecode.c:

Include dependency graph

Go to the source code of this file.


Defines

#define GET_TAG_HEAP(v)   ((v) >> (sizeof(unsigned int)*8-TAGSZ))
#define SET_TAG_HEAP(v, t)   ((v) = (((v) << TAGSZ) >> TAGSZ) | ((t) << (sizeof(unsigned int)*8-TAGSZ)))
#define GET_INT_HEAP(v)   (((int)((v) << TAGSZ)) >> TAGSZ)
#define SET_INT_HEAP(v, i)   ((v) = (((v) >> (sizeof(unsigned int)*8-TAGSZ)) << (sizeof(unsigned int)*8-TAGSZ)) | ((((unsigned int)(i)) << TAGSZ) >> TAGSZ))
#define GET_OFFS_HEAP   GET_INT_HEAP
#define SET_OFFS_HEAP   SET_INT_HEAP

Functions

int fprintf_addr (FILE *f, uint32_t addr)
int sprintf_addr (char *buf, uint32_t addr)
int fprintf_value_tag (FILE *f, TAG_T tag)
int fprintf_value_heap (void *heap, FILE *f, value_t *val)
int fprintf_value (packet_t *p, FILE *f, value_t *val)
int fprintf_opcode (FILE *f, OPCODE_T op)
int fprintf_instr (packet_t *p, FILE *f, instr_t *i)

Define Documentation

#define GET_INT_HEAP      (((int)((v) << TAGSZ)) >> TAGSZ)
 

Definition at line 56 of file snap_bytecode.c.

Referenced by fprintf_value_heap().

#define GET_OFFS_HEAP   GET_INT_HEAP
 

Definition at line 59 of file snap_bytecode.c.

Referenced by fprintf_value_heap().

#define GET_TAG_HEAP      ((v) >> (sizeof(unsigned int)*8-TAGSZ))
 

Definition at line 53 of file snap_bytecode.c.

#define SET_INT_HEAP v,
     ((v) = (((v) >> (sizeof(unsigned int)*8-TAGSZ)) << (sizeof(unsigned int)*8-TAGSZ)) | ((((unsigned int)(i)) << TAGSZ) >> TAGSZ))
 

Definition at line 57 of file snap_bytecode.c.

#define SET_OFFS_HEAP   SET_INT_HEAP
 

Definition at line 60 of file snap_bytecode.c.

#define SET_TAG_HEAP v,
     ((v) = (((v) << TAGSZ) >> TAGSZ) | ((t) << (sizeof(unsigned int)*8-TAGSZ)))
 

Definition at line 54 of file snap_bytecode.c.


Function Documentation

int fprintf_addr FILE *    f,
uint32_t    addr
 

Definition at line 22 of file snap_bytecode.c.

Referenced by fprintf_value_heap().

int fprintf_instr packet_t   p,
FILE *    f,
instr_t   i
 

Definition at line 269 of file snap_bytecode.c.

References ADDI, ADDRV, ANDI, BCASTI, BEZ, BNE, CALLS, COPY_LIT, DIVI, EQADR, EQEXC, EQFLT, EQI, EQINT, EQSTR, EQTUP, EXCV, FADDI, FDIVI, FGEQI, FGTI, FLEQI, FLOATV, FLTI, FMULI, fprintf_opcode(), fprintf_value(), FSUBI, GEQI, GET_OP, GTI, instr_t, INTV, JI, LEQI, LSHLI, LTI, MKTUP, MODI, MULTI, NEQI, NQADR, NQEXC, NQFLT, NQINT, NQSTR, NQTUP, NTH, ORI, PADDR, PAJ, PEXC, PFLT, PINT, POPI, PSTR, PTUP, PULL, PUSH, RSHAI, RSHLI, SNETI, STORE, STRV, SUBI, SVCV, TPAJ, TUPLEV, value_t, and XORI.

Referenced by fprintf_packet().

int fprintf_opcode FILE *    f,
OPCODE_T    op
 

Definition at line 154 of file snap_bytecode.c.

References ADD, ADDI, AND, ANDI, BCAST, BCASTI, BEZ, BNE, CALLS, DEMUX, DEMUXI, DIV, DIVI, EQ, EQADR, EQEXC, EQFLT, EQI, EQINT, EQSTR, EQTUP, EXIT, FADDI, FDIVI, FGEQI, FGTI, FLEQI, FLTI, FMULI, FORW, FORWTO, FSUBI, GEQ, GEQI, GETDST, GETLD, GETRB, GETSPT, GETSRC, GT, GTI, HERE, HOP, ISHERE, ISTUP, ISX, JI, LEN, LEQ, LEQI, LNOT, LSHL, LSHLI, LT, LTI, MKTUP, MOD, MODI, MULT, MULTI, NEG, NEQ, NEQI, NOT, NQADR, NQEXC, NQFLT, NQINT, NQSTR, NQTUP, NTH, OPCODE_T, OR, ORI, PADDR, PAJ, PEXC, PFLT, PINT, POP, POPI, PRINT, PSTR, PTUP, PULL, PUSH, ROUTE, RSHA, RSHAI, RSHL, RSHLI, RTDEV, SEND, SNET, SNETI, STORE, SUB, SUBI, SVCV, TPAJ, XOR, and XORI.

Referenced by fprintf_instr().

int fprintf_value packet_t   p,
FILE *    f,
value_t   val
 

Definition at line 149 of file snap_bytecode.c.

References fprintf_value_heap(), packet_t::heap_min, and value_t.

Referenced by fprintf_instr(), and fprintf_packet().

int fprintf_value_heap void *    heap,
FILE *    f,
value_t   val
 

Definition at line 71 of file snap_bytecode.c.

References ADDRV, EXCV, float32, FLOATV, fprintf_addr(), GET_ADDR_VAL, GET_INT_HEAP, GET_OFFS_HEAP, GET_TAG, INTV, heap_obj::len, heap_obj::s, STRV, TUPLEV, and value_t.

Referenced by fprintf_value().

int fprintf_value_tag FILE *    f,
TAG_T    tag
 

Definition at line 32 of file snap_bytecode.c.

References ADDRV, EXCV, FLOATV, INTV, STRV, TAG_T, and TUPLEV.

int sprintf_addr char *    buf,
uint32_t    addr
 

Definition at line 27 of file snap_bytecode.c.

Referenced by read_routes().