/* mmu.h: memory management context for FR-V with or without MMU support * * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _ASM_MMU_H #define _ASM_MMU_H typedef struct { #ifdef CONFIG_MMU struct list_head id_link; /* link in list of context ID owners */ unsigned short id; /* MMU context ID */ unsigned short id_busy; /* true if ID is in CXNR */ unsigned long itlb_cached_pge; /* [SCR0] PGE cached for insn TLB handler */ unsigned long itlb_ptd_mapping; /* [DAMR4] PTD mapping for itlb cached PGE */ unsigned long dtlb_cached_pge; /* [SCR1] PGE cached for data TLB handler */ unsigned long dtlb_ptd_mapping; /* [DAMR5] PTD mapping for dtlb cached PGE */ #else unsigned long end_brk; #endif #ifdef CONFIG_BINFMT_ELF_FDPIC unsigned long exec_fdpic_loadmap; unsigned long interp_fdpic_loadmap; #endif } mm_context_t; #ifdef CONFIG_MMU extern int __nongpreldata cxn_pinned; extern int cxn_pin_by_pid(pid_t pid); #endif #endif /* _ASM_MMU_H */ tion> connectbot with patches for nfc authenticationJames
aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/sourceforge/jsocks/ProxyMessage.java
blob: 6ea8b4b7b11447dc390189d4c7618915c0b82cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package net.sourceforge.jsocks;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 Abstract class which describes SOCKS4/5 response/request.
*/
public abstract class ProxyMessage{
   /** Host as an IP address */
   public InetAddress ip=null;
   /** SOCKS version, or version of the response for SOCKS4*/
   public int version;
   /** Port field of the request/response*/
   public int port;
   /** Request/response code as an int*/
   public int command;
   /** Host as string.*/
   public String host=null;
   /** User field for SOCKS4 request messages*/
   public String user=null;

   ProxyMessage(int command,InetAddress ip,int port){
      this.command = command;
      this.ip      = ip;
      this.port    = port;
   }

   ProxyMessage(){
   }


   /**
     Initialises Message from the stream. Reads server response from
     given stream.
     @param in Input stream to read response from.
     @throws SocksException If server response code is not SOCKS_SUCCESS(0), or
     if any error with protocol occurs.
     @throws IOException If any error happens with I/O.
   */
   public abstract void read(InputStream in)
                                    throws SocksException,
                                           IOException;


   /**
     Initialises Message from the stream. Reads server response or client 
     request from given stream.
     
     @param in Input stream to read response from.
     @param clinetMode If true read server response, else read client request.
     @throws SocksException If server response code is not SOCKS_SUCCESS(0) and
     reading in client mode, or if any error with protocol occurs.
     @throws IOException If any error happens with I/O.
   */
   public abstract void read(InputStream in,boolean client_mode)
                                    throws SocksException,
                                           IOException;


   /**
    Writes the message to the stream.
    @param out Output stream to which message should be written.
   */
   public abstract void write(OutputStream out)throws SocksException,
                                             IOException;

   /**
    Get the Address field of this message as InetAddress object.
    @return Host address or null, if one can't be determined.
   */
   public InetAddress getInetAddress() throws UnknownHostException{
     return ip;
   }


   /**
    Get string representaion of this message.
    @return string representation of this message.
   */
   public String toString(){
      return 
      "Proxy Message:\n"+
      "Version:"+ version+"\n"+
      "Command:"+ command+"\n"+
      "IP:     "+ ip+"\n"+
      "Port:   "+ port+"\n"+
      "User:   "+ user+"\n" ;
   }

//Package methods
//////////////////

   static final String bytes2IPV4(byte[] addr,int offset){
      String hostName = ""+(addr[offset] & 0xFF);
      for(int i = offset+1;i<offset+4;++i)
        hostName+="."+(addr[i] & 0xFF);
      return hostName;
   }

   static final String bytes2IPV6(byte[] addr,int offset){
     //Have no idea how they look like!
     return null;
   }

}