• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2015 syzkaller project authors. All rights reserved.
2// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
3
4// Package rpctype contains types of message passed via net/rpc connections
5// between various parts of the system.
6package rpctype
7
8import (
9	"github.com/google/syzkaller/pkg/host"
10	"github.com/google/syzkaller/pkg/ipc"
11	"github.com/google/syzkaller/pkg/signal"
12)
13
14type RPCInput struct {
15	Call   string
16	Prog   []byte
17	Signal signal.Serial
18	Cover  []uint32
19}
20
21type RPCCandidate struct {
22	Prog      []byte
23	Minimized bool
24	Smashed   bool
25}
26
27type ConnectArgs struct {
28	Name string
29}
30
31type ConnectRes struct {
32	EnabledCalls   []int
33	GitRevision    string
34	TargetRevision string
35	AllSandboxes   bool
36	CheckResult    *CheckArgs
37}
38
39type CheckArgs struct {
40	Name          string
41	Error         string
42	EnabledCalls  map[string][]int
43	DisabledCalls map[string][]SyscallReason
44	Features      *host.Features
45}
46
47type SyscallReason struct {
48	ID     int
49	Reason string
50}
51
52type NewInputArgs struct {
53	Name string
54	RPCInput
55}
56
57type PollArgs struct {
58	Name           string
59	NeedCandidates bool
60	MaxSignal      signal.Serial
61	Stats          map[string]uint64
62}
63
64type PollRes struct {
65	Candidates []RPCCandidate
66	NewInputs  []RPCInput
67	MaxSignal  signal.Serial
68}
69
70type HubConnectArgs struct {
71	// Client/Key are used for authentication.
72	Client string
73	Key    string
74	// Manager name, must start with Client.
75	Manager string
76	// Manager has started with an empty corpus and requests whole hub corpus.
77	Fresh bool
78	// Set of system call names supported by this manager.
79	// Used to filter out programs with unsupported calls.
80	Calls []string
81	// Current manager corpus.
82	Corpus [][]byte
83}
84
85type HubSyncArgs struct {
86	// see HubConnectArgs.
87	Client     string
88	Key        string
89	Manager    string
90	NeedRepros bool
91	// Programs added to corpus since last sync or connect.
92	Add [][]byte
93	// Hashes of programs removed from corpus since last sync or connect.
94	Del []string
95	// Repros found since last sync.
96	Repros [][]byte
97}
98
99type HubSyncRes struct {
100	// Set of programs from other managers.
101	Progs [][]byte
102	// Set of repros from other managers.
103	Repros [][]byte
104	// Number of remaining pending programs,
105	// if >0 manager should do sync again.
106	More int
107}
108
109type RunTestPollReq struct {
110	Name string
111}
112
113type RunTestPollRes struct {
114	ID     int
115	Bin    []byte
116	Prog   []byte
117	Cfg    *ipc.Config
118	Opts   *ipc.ExecOpts
119	Repeat int
120}
121
122type RunTestDoneArgs struct {
123	Name   string
124	ID     int
125	Output []byte
126	Info   [][]ipc.CallInfo
127	Error  string
128}
129