| 26 | import packetproxy.model.Packet.Direction; |
| 27 | |
| 28 | public class OneShotPacket implements PacketInfo, Cloneable { |
| 29 | |
| 30 | private int id; |
| 31 | private Packet.Direction direction; |
| 32 | private byte[] data; |
| 33 | private int listen_port; |
| 34 | private String client_ip; |
| 35 | private int client_port; |
| 36 | private String server_ip; |
| 37 | private int server_port; |
| 38 | private String server_name; |
| 39 | private boolean use_ssl; |
| 40 | private String encoder_name; |
| 41 | private String alpn; |
| 42 | private boolean auto_modified; |
| 43 | private int conn; |
| 44 | private long group; |
| 45 | |
| 46 | public OneShotPacket() { |
| 47 | } |
| 48 | |
| 49 | public OneShotPacket(int id, int listen_port, InetSocketAddress client_addr, InetSocketAddress server_addr, |
| 50 | String server_name, boolean use_ssl, byte[] data, String encoder_name, String alpn, Packet.Direction dir, |
| 51 | int conn, long group) { |
| 52 | initialize(id, listen_port, client_addr.getAddress().getHostAddress(), client_addr.getPort(), |
| 53 | server_addr.getAddress().getHostAddress(), server_addr.getPort(), server_name, use_ssl, data, |
| 54 | encoder_name, alpn, dir, conn, group); |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public Object clone() throws CloneNotSupportedException { |
| 59 | return super.clone(); |
| 60 | } |
| 61 | |
| 62 | private void initialize(int id, int listen_port, String client_ip, int client_port, String server_ip, |
| 63 | int server_port, String server_name, boolean use_ssl, byte[] data, String encoder_name, String alpn, |
| 64 | Packet.Direction dir, int conn, long group) { |
| 65 | this.id = id; |
| 66 | this.listen_port = listen_port; |
| 67 | this.client_ip = client_ip; |
| 68 | this.client_port = client_port; |
| 69 | this.server_ip = server_ip; |
| 70 | this.server_port = server_port; |
| 71 | this.server_name = server_name; |
| 72 | this.use_ssl = use_ssl; |
| 73 | this.data = data; |
| 74 | this.encoder_name = encoder_name; |
| 75 | this.alpn = alpn; |
| 76 | this.direction = dir; |
| 77 | this.auto_modified = false; |
| 78 | this.conn = conn; |
| 79 | this.group = group; |
| 80 | } |
| 81 | |
| 82 | public Packet.Direction getDirection() { |
| 83 | return this.direction; |
| 84 | } |
| 85 |
nothing calls this directly
no outgoing calls
no test coverage detected