Documentation
¶
Overview ¶
Package sdk provides the multi-language SDK export layer. It exposes core PSL functionality as C-compatible functions that can be called from Python, Rust, JavaScript, and C/C++.
Index ¶
- func AllocCString(s string) *byte
- func CPSLDecode(h Handle, proto string, data []byte) (string, error)
- func CPSLEncode(h Handle, proto string, fieldsJSON string) ([]byte, error)
- func CPSLFree(h Handle)
- func CPSLList(h Handle) (string, error)
- func CPSLLoad(h Handle, path string) error
- func Decode(h Handle, protoName string, data []byte) (string, error)
- func Encode(h Handle, protoName string, fieldsJSON string) ([]byte, error)
- func FreeCString(p *byte)
- func FreeLibrary(h Handle)
- func GenerateCHeader() string
- func GenerateCMakeExample() string
- func GeneratePythonBinding() string
- func GenerateRustBinding() string
- func GenerateScapyInterop() string
- func GenerateTypeScriptBinding() string
- func GetLibrary(h Handle) *protocol.Library
- func GoString(p *byte) string
- func ListProtocols(h Handle) (string, error)
- func LoadPSL(h Handle, filePath string) error
- type CResult
- type Handle
- type SDKError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocCString ¶
AllocCString allocates a null-terminated C string from a Go string.
func CPSLDecode ¶
CPSLDecode decodes binary data and returns JSON result.
func CPSLEncode ¶
CPSLEncode encodes JSON fields to binary.
func FreeCString ¶
func FreeCString(p *byte)
FreeCString frees a C string allocated by AllocCString. In practice, Go's GC handles this, but we provide the API for symmetry.
func GenerateCHeader ¶
func GenerateCHeader() string
GenerateCHeader generates a C header file for the PSL shared library.
func GenerateCMakeExample ¶
func GenerateCMakeExample() string
GenerateCMakeExample generates a CMake integration example.
func GeneratePythonBinding ¶
func GeneratePythonBinding() string
GeneratePythonBinding generates a Python ctypes binding module.
func GenerateRustBinding ¶
func GenerateRustBinding() string
GenerateRustBinding generates a Rust FFI binding module.
func GenerateScapyInterop ¶
func GenerateScapyInterop() string
GenerateScapyInterop generates Python code for Scapy integration.
func GenerateTypeScriptBinding ¶
func GenerateTypeScriptBinding() string
GenerateTypeScriptBinding generates a TypeScript/Node.js binding module.
func GetLibrary ¶
GetLibrary retrieves the library for a handle.
func ListProtocols ¶
ListProtocols returns all protocol names as JSON array.
Types ¶
type Handle ¶
type Handle uintptr
Handle is an opaque pointer to a Library instance.
func NewLibrary ¶
NewLibrary creates a new PSL library instance and returns a handle.