codegen

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutOfLineSuffix = "OutOfLine"
	InLineSuffix    = "InLine"
	RequestSuffix   = "Request"
	ResponseSuffix  = "Response"
	EventSuffix     = "Event"
	HandlesSuffix   = "Handles"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bits

type Bits struct {
	Name    string
	Type    string
	Members []string
}

Bits represents a set of syzkaller flags

type Enum

type Enum struct {
	Name    string
	Type    string
	Members []string
}

Enum represents a set of syzkaller flags

type Generator

type Generator struct {
	*fidlgen.Generator
}

func NewGenerator

func NewGenerator() Generator

func (Generator) GenerateSyscallDescription

func (g Generator) GenerateSyscallDescription(filename string, root fidlgen.Root) error

type Method

type Method struct {
	// Ordinal is the ordinal for this method.
	Ordinal uint64

	// Name is the name of the Method, including the protocol name as a prefix.
	Name string

	// Request represents a struct containing the request parameters.
	Request *Struct

	// RequestHandles represents a struct containing the handles in the request parameters.
	RequestHandles *Struct

	// Response represents an optional struct containing the response parameters.
	Response *Struct

	// ResponseHandles represents a struct containing the handles in the response parameters.
	ResponseHandles *Struct

	// Structs contain all the structs generated during depth-first traversal of Request/Response.
	Structs []Struct

	// Unions contain all the unions generated during depth-first traversal of Request/Response.
	Unions []Union
}

Method represents a method of a FIDL protocol in terms of syzkaller syscalls.

type Protocol

type Protocol struct {
	Name string

	// ServiceNameString is the string service name for this FIDL protocol.
	ServiceNameString string

	// Methods is a list of methods for this FIDL protocol.
	Methods []Method
}

Protocol represents a FIDL protocol in terms of syzkaller structures.

type Root

type Root struct {
	// Name is the name of the library.
	Name string

	// C header file path to be included in syscall description.
	HeaderPath string

	// Protocols represent the list of FIDL protocols represented as a collection of syskaller syscall descriptions.
	Protocols []Protocol

	// Structs correspond to syzkaller structs.
	Structs []Struct

	// Unions correspond to syzkaller unions.
	Unions []Union

	// Enums correspond to syzkaller flags.
	Enums []Enum

	// Bits correspond to syzkaller flags.
	Bits []Bits
}

Root is the root of the syzkaller backend IR structure.

type Struct

type Struct struct {
	Name    string
	Members []StructMember
}

Struct represents a syzkaller struct.

type StructMember

type StructMember struct {
	Name string
	Type Type
}

StructMember represents a member of a syzkaller struct.

type Type

type Type string

Type represents a syzkaller type including type-options.

type Union

type Union struct {
	Name    string
	Members []StructMember
	VarLen  bool
}

Union represents a syzkaller union.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL