forked from netblue30/firejail
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
netblue30
committed
Oct 27, 2016
1 parent
834da29
commit abe5cb0
Showing
13 changed files
with
429 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
all: fnet | ||
|
||
prefix=@prefix@ | ||
exec_prefix=@exec_prefix@ | ||
libdir=@libdir@ | ||
sysconfdir=@sysconfdir@ | ||
|
||
VERSION=@PACKAGE_VERSION@ | ||
NAME=@PACKAGE_NAME@ | ||
HAVE_SECCOMP_H=@HAVE_SECCOMP_H@ | ||
HAVE_SECCOMP=@HAVE_SECCOMP@ | ||
HAVE_CHROOT=@HAVE_CHROOT@ | ||
HAVE_BIND=@HAVE_BIND@ | ||
HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@ | ||
HAVE_NETWORK=@HAVE_NETWORK@ | ||
HAVE_USERNS=@HAVE_USERNS@ | ||
HAVE_X11=@HAVE_X11@ | ||
HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@ | ||
HAVE_WHITELIST=@HAVE_WHITELIST@ | ||
HAVE_GLOBALCFG=@HAVE_GLOBALCFG@ | ||
HAVE_APPARMOR=@HAVE_APPARMOR@ | ||
HAVE_OVERLAYFS=@HAVE_OVERLAYFS@ | ||
HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@ | ||
EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@ | ||
|
||
H_FILE_LIST = $(sort $(wildcard *.[h])) | ||
C_FILE_LIST = $(sort $(wildcard *.c)) | ||
OBJS = $(C_FILE_LIST:.c=.o) | ||
BINOBJS = $(foreach file, $(OBJS), $file) | ||
CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security | ||
LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread | ||
|
||
%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/libnetlink.h ../include/pid.h | ||
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ | ||
|
||
fnet: $(OBJS) ../lib/libnetlink.o ../lib/common.o | ||
$(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/libnetlink.o ../lib/common.o $(LIBS) $(EXTRA_LDFLAGS) | ||
|
||
clean:; rm -f *.o fnet | ||
|
||
distclean: clean | ||
rm -fr Makefile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2014-2016 Firejail Authors | ||
* | ||
* This file is part of firejail project | ||
* | ||
* This program 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 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program 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, write to the Free Software Foundation, Inc., | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
*/ | ||
#ifndef FNET_H | ||
#define FNET_H | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <assert.h> | ||
#include "../include/common.h" | ||
|
||
// veth.c | ||
int net_create_veth(const char *dev, const char *nsdev, unsigned pid); | ||
int net_create_macvlan(const char *dev, const char *parent, unsigned pid); | ||
int net_move_interface(const char *dev, unsigned pid); | ||
|
||
// interface.c | ||
void net_bridge_add_interface(const char *bridge, const char *dev); | ||
void net_if_up(const char *ifname); | ||
int net_get_mtu(const char *ifname); | ||
void net_set_mtu(const char *ifname, int mtu); | ||
|
||
#endif |
Oops, something went wrong.