aboutsummaryrefslogtreecommitdiff
path: root/device.h
blob: 23e85ac0e350fddeade01cb4605bd1183b1cb1d4 (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
/*
 *
 * Copyright (C) 2022 Jeremias Stotter <jeremias@stotter.eu>
 *
 * This file is part of network-simulator.
 *
 * network-simulator 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.
 *
 * network-simulator 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 network-simulator. If not, see <https://www.gnu.org/licenses/>. 
*/

#ifndef NETSIM_DEVICE
#define NETSIM_DEVICE
#include "shared.h"
extern struct device* start_device;
void rename_device(struct device* dev, const char* name);
struct device* new_device(struct device** start, char* device_name, struct dev_template* cur_template, bool create_interfaces);
struct device* new_device_from_template_name(struct device** start, char* device_name, const char* template_name, bool create_interfaces);
// Append an existing device to the end of the list
void append_device(struct device** start, struct device* dev);
int free_device(struct device* del_device);
int delete_device(struct device** start, struct device* del_device);
// Use this function to interact with a devices commandline
int device_cmdline(struct device* target_device, const char* cmdline);
//void get_cmdline(struct device* dev, int n_lines, char** lines);
void append_cmdline(struct device* dev, const char* in_string, int in_string_len);
struct device* dev_from_name(struct device* start, const char* name);
void append_cmd_history(struct device* dev, const char* text);
void reload_templates();
#endif
Jeremias Stotters git repositories generated by CGIT