// Java Package psi is a proxy for talking to a Go program. // gobind -lang=java github.com/Psiphon-Labs/psiphon-tunnel-core/AndroidLibrary/psi // // File is generated by gobind. Do not edit. package go.psi; import go.Seq; public abstract class Psi { private Psi() {} // uninstantiable public interface PsiphonProvider extends go.Seq.Object { public void BindToDevice(long fileDescriptor); public void Notice(String message); public static abstract class Stub implements PsiphonProvider { static final String DESCRIPTOR = "go.psi.PsiphonProvider"; private final go.Seq.Ref ref; public Stub() { ref = go.Seq.createRef(this); } public go.Seq.Ref ref() { return ref; } public void call(int code, go.Seq in, go.Seq out) { switch (code) { case Proxy.CALL_BindToDevice: { long param_fileDescriptor = in.readInt(); this.BindToDevice(param_fileDescriptor); return; } case Proxy.CALL_Notice: { String param_message = in.readUTF16(); this.Notice(param_message); return; } default: throw new RuntimeException("unknown code: "+ code); } } } static final class Proxy implements PsiphonProvider { static final String DESCRIPTOR = Stub.DESCRIPTOR; private go.Seq.Ref ref; Proxy(go.Seq.Ref ref) { this.ref = ref; } public go.Seq.Ref ref() { return ref; } public void call(int code, go.Seq in, go.Seq out) { throw new RuntimeException("cycle: cannot call proxy"); } public void BindToDevice(long fileDescriptor) { go.Seq _in = new go.Seq(); go.Seq _out = new go.Seq(); _in.writeRef(ref); _in.writeInt(fileDescriptor); Seq.send(DESCRIPTOR, CALL_BindToDevice, _in, _out); } public void Notice(String message) { go.Seq _in = new go.Seq(); go.Seq _out = new go.Seq(); _in.writeRef(ref); _in.writeUTF16(message); Seq.send(DESCRIPTOR, CALL_Notice, _in, _out); } static final int CALL_BindToDevice = 0x10a; static final int CALL_Notice = 0x20a; } } public static void Start(String configJson, PsiphonProvider provider) throws Exception { go.Seq _in = new go.Seq(); go.Seq _out = new go.Seq(); _in.writeUTF16(configJson); _in.writeRef(provider.ref()); Seq.send(DESCRIPTOR, CALL_Start, _in, _out); String _err = _out.readUTF16(); if (_err != null) { throw new Exception(_err); } } public static void Stop() { go.Seq _in = new go.Seq(); go.Seq _out = new go.Seq(); Seq.send(DESCRIPTOR, CALL_Stop, _in, _out); } private static final int CALL_Start = 1; private static final int CALL_Stop = 2; private static final String DESCRIPTOR = "psi"; }