nsjail/net.h

42 lines
1.1 KiB
C
Raw Normal View History

2015-05-15 05:44:48 +08:00
/*
nsjail - networking routines
-----------------------------------------
Copyright 2014 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
2016-03-02 00:03:11 +08:00
2016-03-11 09:45:43 +08:00
#ifndef NS_NET_H
#define NS_NET_H
2015-05-15 05:44:48 +08:00
#include <stdbool.h>
#include <stddef.h>
#include "nsjail.h"
2015-05-15 05:44:48 +08:00
2018-02-10 00:27:28 +08:00
namespace net {
2018-02-10 22:50:12 +08:00
bool limitConns(nsjconf_t* nsjconf, int connsock);
2018-02-10 00:27:28 +08:00
int getRecvSocket(const char* bindhost, int port);
int acceptConn(int listenfd);
void connToText(int fd, bool remote, char* buf, size_t s, struct sockaddr_in6* addr_or_null);
2018-02-10 22:50:12 +08:00
bool initNsFromParent(nsjconf_t* nsjconf, int pid);
bool initNsFromChild(nsjconf_t* nsjconf);
2018-02-10 00:27:28 +08:00
} // namespace net
2018-02-08 22:24:17 +08:00
2017-10-09 05:00:45 +08:00
#endif /* _NET_H */