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
1 parent
0b3cf88
commit 0b3ac29
Showing
8 changed files
with
244 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2015 OpenSIPS Project | ||
* | ||
* This file is part of opensips, a free SIP server. | ||
* | ||
* opensips 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. | ||
* | ||
* opensips 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
* | ||
* history: | ||
* --------- | ||
* 2015-01-xx created (razvanc) | ||
*/ | ||
|
||
#include <string.h> | ||
#include "net.h" | ||
#include "../mem/mem.h" | ||
|
||
struct proto_net *proto_net_binds; | ||
|
||
int init_net_interface(int size) | ||
{ | ||
proto_net_binds = pkg_malloc(size * sizeof(struct proto_net)); | ||
if (!proto_net_binds) { | ||
LM_ERR("no more memory to allocate protocol bindings\n"); | ||
return -1; | ||
} | ||
|
||
memset(proto_net_binds, 0, size * sizeof(struct proto_net)); | ||
|
||
return 0; | ||
} | ||
|
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,37 @@ | ||
/* | ||
* Copyright (C) 2015 OpenSIPS Project | ||
* | ||
* This file is part of opensips, a free SIP server. | ||
* | ||
* opensips 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. | ||
* | ||
* opensips 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
* | ||
* history: | ||
* --------- | ||
* 2015-01-xx created (razvanc) | ||
*/ | ||
|
||
#ifndef _NET_TI_H_ | ||
#define _NET_TI_H_ | ||
|
||
#include "../ip_addr.h" | ||
#include "proto_net.h" | ||
|
||
extern struct proto_net *proto_net_binds; | ||
|
||
int init_net_interface(int size); | ||
int destroy_net_interface(int size); | ||
|
||
#endif /* _NET_TI_H_ */ |
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,77 @@ | ||
/* | ||
* Copyright (C) 2015 OpenSIPS Project | ||
* | ||
* This file is part of opensips, a free SIP server. | ||
* | ||
* opensips 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. | ||
* | ||
* opensips 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
* | ||
* history: | ||
* --------- | ||
* 2015-01-xx created (razvanc) | ||
*/ | ||
|
||
#include <string.h> | ||
#include "net_tcp.h" | ||
|
||
|
||
// initializes the TCP structures | ||
int tcp_init(void) | ||
{ | ||
// TODO: implementation | ||
return -1; | ||
} | ||
|
||
// destroys the TCP data | ||
void tcp_destroy(void) | ||
{ | ||
// TODO: implementation | ||
} | ||
|
||
// looks for the transport protocol that knows how to handle the | ||
// proto and calls the corresponding add_listener() function | ||
int tcp_add_listener(char* host, int port, int type, void *ctx) | ||
{ | ||
// TODO: implementation | ||
return 0; | ||
} | ||
|
||
// used to return a listener | ||
struct socket_info* tcp_find_listener(union sockaddr_union* to, int proto) | ||
{ | ||
// TODO: implementation | ||
return NULL; | ||
} | ||
|
||
// initializes the TCP listeners | ||
int tcp_init_listeners(void) | ||
{ | ||
// TODO: implementation | ||
return -1; | ||
} | ||
|
||
// returns the connection identified by either the id or the destination to | ||
struct connection* tcp_conn_get(int id, union sockaddr_union* to) | ||
{ | ||
// TODO: implementation | ||
return NULL; | ||
} | ||
|
||
// used to tune the connection attributes | ||
int tcp_conn_fcntl(struct connection *conn, int attr, void *value) | ||
{ | ||
// TODO: implementation | ||
return -1; | ||
} |
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,32 @@ | ||
/* | ||
* Copyright (C) 2015 OpenSIPS Project | ||
* | ||
* This file is part of opensips, a free SIP server. | ||
* | ||
* opensips 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. | ||
* | ||
* opensips 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
* | ||
* history: | ||
* --------- | ||
* 2015-01-xx created (razvanc) | ||
*/ | ||
|
||
#ifndef _PROTO_NET_H_ | ||
#define _PROTO_NET_H_ | ||
|
||
struct proto_net { | ||
}; | ||
|
||
#endif /*_PROTO_NET_H_ */ |
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