proxy_amd64.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // +build !windows
  15. #ifndef PROXY_H
  16. #define PROXY_H
  17. #include <netinet/in.h>
  18. #ifdef CMD_DEFINE
  19. # define cmdexport
  20. #else
  21. # define cmdexport static
  22. #endif
  23. cmdexport const int CMD_SET_ROUTE = 1;
  24. cmdexport const int CMD_DEL_ROUTE = 2;
  25. cmdexport const int CMD_STOP = 3;
  26. typedef struct command {
  27. int cmd;
  28. in_addr_t dest_net;
  29. int dest_net_len;
  30. in_addr_t next_hop_ip;
  31. short next_hop_port;
  32. } command;
  33. void run_proxy(int tun, int sock, int ctl, in_addr_t tun_ip, size_t tun_mtu, int log_errors);
  34. #endif