proxy.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2015 CoreOS, Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef PROXY_H
  15. #define PROXY_H
  16. #include <netinet/in.h>
  17. #ifdef CMD_DEFINE
  18. # define cmdexport
  19. #else
  20. # define cmdexport static
  21. #endif
  22. cmdexport const int CMD_SET_ROUTE = 1;
  23. cmdexport const int CMD_DEL_ROUTE = 2;
  24. cmdexport const int CMD_STOP = 3;
  25. typedef struct command {
  26. int cmd;
  27. in_addr_t dest_net;
  28. int dest_net_len;
  29. in_addr_t next_hop_ip;
  30. short next_hop_port;
  31. } command;
  32. void run_proxy(int tun, int sock, int ctl, in_addr_t tun_ip, size_t tun_mtu, int log_errors);
  33. #endif