 /*
  * util.h
  * Copyright (C) Aitor Cuadrado Zubizarreta <aitor@genuen.org>
  * 
  * simple-netaid 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 3 of the License, or
  * (at your option) any later version.
  * 
  * simple-netaid is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License along
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  * 
  * See the COPYING file.
  */
  
  
#ifndef __UTIL_H__
#define __UTIL_H__

#include <stdlib.h>
#include <stdbool.h>

char *escape_ssid(const char *src);
int append_wpa_config(const char *essid, const char *passwd, const char *filename);
int safe_execute(const char *out_path, char *const argv[]);
int lock_file(const char*, int);
pid_t get_pid_t(void);
int wait_on_kill(int, int);
void daemonize();
void get_interfaces_simple(char *wired, size_t w_len, char *wireless, size_t wl_len);
void ipaddr_flush_all_devices();
void wired_teardown(const char *ifname, bool leave_admin_up);
int wired_connection(const char*);
void wired_disconnect(const char*);
int wireless_connection(const char*);
bool is_wpa_conf_file(const char *path);

#endif  //  __UTIL_H__
