]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/network.h
network: send names for all non-trivial network types
[mirror_lxc.git] / src / lxc / network.h
index 468593f5e3a0938e2318d659a78fb5a124e76bd2..483fbb8cd430a1d14e8c14ce580760899c95bfd6 100644 (file)
@@ -122,6 +122,7 @@ struct ifla_ipvlan {
  */
 struct ifla_phys {
        int ifindex;
+       int mtu;
 };
 
 union netdev_p {
@@ -146,7 +147,10 @@ union netdev_p {
  * @flags             : flag of the network device (IFF_UP, ... )
  * @link              : lxc.net.[i].link, name of bridge or host iface to attach
  *                      if any
- * @name              : lxc.net.[i].name, name of iface on the container side
+ * @name             : lxc.net.[i].name, name of iface on the container side
+ * @created_name      : the name with which this interface got created before
+ *                     being renamed to final_name.
+ *                     Currenly only used for veth devices.
  * @hwaddr            : mac address
  * @mtu               : maximum transmission unit
  * @priv              : information specific to the specificed network type
@@ -156,9 +160,11 @@ union netdev_p {
  * @ipv6              : a list of ipv6 addresses to be set on the network device
  * @ipv4_gateway_auto : whether the ipv4 gateway is to be automatically gathered
  *                      from the associated @link
+ * @ipv4_gateway_dev  : whether the ipv4 gateway is to be set as a device route
  * @ipv4_gateway      : ipv4 gateway
  * @ipv6_gateway_auto : whether the ipv6 gateway is to be automatically gathered
  *                      from the associated @link
+ * @ipv6_gateway_dev  : whether the ipv6 gateway is to be set as a device route
  * @ipv6_gateway      : ipv6 gateway
  * @upscript          : a script filename to be executed during interface
  *                      configuration
@@ -173,14 +179,17 @@ struct lxc_netdev {
        char link[IFNAMSIZ];
        bool l2proxy;
        char name[IFNAMSIZ];
+       char created_name[IFNAMSIZ];
        char *hwaddr;
        char *mtu;
        union netdev_p priv;
        struct lxc_list ipv4;
        struct lxc_list ipv6;
        bool ipv4_gateway_auto;
+       bool ipv4_gateway_dev;
        struct in_addr *ipv4_gateway;
        bool ipv6_gateway_auto;
+       bool ipv6_gateway_dev;
        struct in6_addr *ipv6_gateway;
        char *upscript;
        char *downscript;
@@ -262,24 +271,19 @@ extern char *lxc_mkifname(char *template);
 extern const char *lxc_net_type_to_str(int type);
 extern int setup_private_host_hw_addr(char *veth1);
 extern int netdev_get_mtu(int ifindex);
-extern int lxc_create_network_priv(struct lxc_handler *handler);
-extern int lxc_network_move_created_netdev_priv(const char *lxcpath,
-                                               const char *lxcname,
-                                               struct lxc_list *network,
-                                               pid_t pid);
+extern int lxc_network_move_created_netdev_priv(struct lxc_handler *handler);
 extern void lxc_delete_network(struct lxc_handler *handler);
 extern int lxc_find_gateway_addresses(struct lxc_handler *handler);
-extern int lxc_create_network_unpriv(const char *lxcpath, const char *lxcname,
-                                    struct lxc_list *network, pid_t pid, unsigned int hook_version);
 extern int lxc_requests_empty_network(struct lxc_handler *handler);
 extern int lxc_restore_phys_nics_to_netns(struct lxc_handler *handler);
 extern int lxc_setup_network_in_child_namespaces(const struct lxc_conf *conf,
                                                 struct lxc_list *network);
-extern int lxc_network_send_veth_names_to_child(struct lxc_handler *handler);
-extern int lxc_network_recv_veth_names_from_parent(struct lxc_handler *handler);
+extern int lxc_network_send_to_child(struct lxc_handler *handler);
+extern int lxc_network_recv_from_parent(struct lxc_handler *handler);
 extern int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler);
 extern int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *handler);
 extern int lxc_netns_set_nsid(int netns_fd);
 extern int lxc_netns_get_nsid(__s32 fd);
+extern int lxc_create_network(struct lxc_handler *handler);
 
 #endif /* __LXC_NETWORK_H */