Skip to content

Commit

Permalink
Original source code
Browse files Browse the repository at this point in the history
Original source code from ps3netsrv project (from aldostools/webMan-MOD/_Projects_/ps3netsrv)
  • Loading branch information
JCorrea committed Mar 1, 2020
0 parents commit 3107bba
Show file tree
Hide file tree
Showing 148 changed files with 67,864 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build*
54 changes: 54 additions & 0 deletions LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
(C) 2010-2019 multiMAN / webMAN

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


2014-2019 webMAN MOD / ps3netsrv

webMAN MOD is a FREE software and all its components are distributed
and protected under GNU General Public License version 3 (GPL v3) as
published by the Free Software Foundation, or (at your option) any
later version..

That means that any change made to the source code, binaries or resources
of this software should be made public. A detailed list of the changes
and the credits to the original authors are required.

It is not permitted to distribute modified versions with the same name
of this software. A similar name or misleading name should NOT be used,
to avoid confusion about the origin or the version in use.

For futher information about GPL v3, refer to:
https://www.gnu.org/licenses/gpl-3.0.en.html

The software is distributed "as is". No warranty of any kind is expressed
or implied. You use at your own risk. Neither the author, the licensor nor
the agents of the licensor will be liable for data loss, damages, loss of
profits or any other kind of loss while using or misusing this software or
its components.

Furthermore, the author and his ASSOCIATES shall assume NO responsibility,
legal or otherwise implied, for any misuse of, or for any loss that may
occur while using the SOFTWARE or its components.

Installing and using the software signifies acceptance of these terms and
conditions of the license. If you do not agree with the terms of this license,
you must remove all software files from your storage devices and cease to use
the software.
14 changes: 14 additions & 0 deletions Make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

if [ -f polarssl-1.3.2/bin/libpolarssl-linux.a ]
then
mv polarssl-1.3.2/bin/libpolarssl-linux.a polarssl-1.3.2/library/libpolarssl.a
fi

if [ -f Makefile.linux ]
then
mv Makefile Makefile.win
mv Makefile.linux Makefile
fi

make
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
OS = windows
BUILD_TYPE = release_static

OUTPUT := ps3netsrv
OBJS = src/main.o src/compat.o src/File.o src/VIsoFile.o

CFLAGS = -Wall -I./include -I./polarssl-1.3.2/include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
CPPFLAGS += -Wall -I./include -I./polarssl-1.3.2/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL

#CFLAGS += -DNOSSL
#CPPFLAGS +=-DNOSSL

LDFLAGS = -L. -L./polarssl-1.3.2/library
LIBS = -lstdc++ -lpolarssl


ifeq ($(OS), linux)
LIBS += -lpthread
endif

ifeq ($(OS), windows)
OBJS += src/scandir.o src/dirent.o
CC = gcc
CXX = g++
LIBS += -lws2_32
OUTPUT := $(OUTPUT).exe
endif

ifeq ($(OS), cross)
OBJS += scandir.o dirent.o
CC = i586-pc-mingw32-gcc
CXX = i586-pc-mingw32-g++
LIBS += -lws2_32
OUTPUT := $(OUTPUT).exe
endif

ifeq ($(BUILD_TYPE), debug)
CFLAGS += -O0 -g3 -DDEBUG
CPPFLAGS += -O0 -g3 -DDEBUG
endif

ifeq ($(BUILD_TYPE), debug_static)
CFLAGS += -O0 -static -g3 -DDEBUG
CPPFLAGS += -O0 -static -g3 -DDEBUG
endif

ifeq ($(BUILD_TYPE), release)
CFLAGS += -O3 -s -DNDEBUG
CPPFLAGS += -O3 -s -DNDEBUG
endif

ifeq ($(BUILD_TYPE), release_static)
CFLAGS += -static -O3 -s -DNDEBUG
CPPFLAGS += -static -O3 -s -DNDEBUG
endif

all: $(OUTPUT)
rm -r -f src/*.o

clean:
rm -r -f $(OUTPUT) src/*.o

$(OUTPUT): $(OBJS)
$(LINK.c) $(LDFLAGS) -o $@ $^ $(LIBS)
61 changes: 61 additions & 0 deletions Makefile.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
OS = linux
BUILD_TYPE = release_static

OUTPUT := ps3netsrv
OBJS = src/main.o src/compat.o src/File.o src/VIsoFile.o

CFLAGS = -Wall -I./include -I./polarssl-1.3.2/include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
CPPFLAGS += -Wall -I./include -I./polarssl-1.3.2/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL

#CFLAGS += -DNOSSL
#CPPFLAGS +=-DNOSSL

LDFLAGS = -L. -L./polarssl-1.3.2/library
LIBS = -lstdc++ -lpolarssl


ifeq ($(OS), linux)
LIBS += -lpthread
endif

ifeq ($(OS), windows)
OBJS += src/scandir.o src/dirent.o
CC = gcc
CXX = g++
LIBS += -lws2_32
OUTPUT := $(OUTPUT).exe
endif

ifeq ($(OS), cross)
OBJS += scandir.o dirent.o
CC = i586-pc-mingw32-gcc
CXX = i586-pc-mingw32-g++
LIBS += -lws2_32
OUTPUT := $(OUTPUT).exe
endif

ifeq ($(BUILD_TYPE), debug)
CFLAGS += -DDEBUG
CPPFLAGS += -DDEBUG
endif

ifeq ($(BUILD_TYPE), debug_static)
CFLAGS += -DDEBUG -static
CPPFLAGS += -DDEBUG
endif

ifeq ($(BUILD_TYPE), release)
endif

ifeq ($(BUILD_TYPE), release_static)
CFLAGS += -static
endif

all: $(OUTPUT)
rm -r -f src/*.o

clean:
rm -r -f $(OUTPUT) src/*.o

$(OUTPUT): $(OBJS)
$(LINK.c) $(LDFLAGS) -o $@ $^ $(LIBS)
65 changes: 65 additions & 0 deletions Makefile.macos
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
OS = macos
BUILD_TYPE = release

OUTPUT := ps3netsrv
OBJS = src/main.o src/compat.o src/File.o src/VIsoFile.o

CFLAGS = -Wall -I./include -I./polarssl-1.3.2/include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL
CPPFLAGS += -Wall -I./include -I./polarssl-1.3.2/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL

CFLAGS += -Doff64_t=off_t
CPPFLAGS += -Doff64_t=off_t

LDFLAGS = -L. -L./polarssl-1.3.2/library
LIBS = -lstdc++ -lpolarssl


ifeq ($(OS), linux)
LIBS += -lpthread
endif

ifeq ($(OS), macos)
LIBS += -lpthread
endif

ifeq ($(OS), windows)
OBJS += src/scandir.o src/dirent.o
CC = gcc
CXX = g++
LIBS += -lws2_32
OUTPUT := $(OUTPUT).exe
endif

ifeq ($(OS), cross)
OBJS += scandir.o dirent.o
CC = i586-pc-mingw32-gcc
CXX = i586-pc-mingw32-g++
LIBS += -lws2_32
OUTPUT := $(OUTPUT).exe
endif

ifeq ($(BUILD_TYPE), debug)
CFLAGS += -DDEBUG
CPPFLAGS += -DDEBUG
endif

ifeq ($(BUILD_TYPE), debug_static)
CFLAGS += -DDEBUG -static
CPPFLAGS += -DDEBUG
endif

ifeq ($(BUILD_TYPE), release)
endif

ifeq ($(BUILD_TYPE), release_static)
CFLAGS += -static
endif

all: $(OUTPUT)
rm -r -f src/*.o

clean:
rm -r -f $(OUTPUT) src/*.o

$(OUTPUT): $(OBJS)
$(LINK.c) $(LDFLAGS) -o $@ $^ $(LIBS)
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ps3netsrv

## Requirements

* A C/C++ compiler

* [Meson](https://mesonbuild.com/Getting-meson.html)

* [mbed TLS](https://tls.mbed.org/)
* Is being searched for in system library directory (e.g. `/usr/lib`) and custom directories specified in `LIBRARY_PATH`.
If using a custom directory, put the path to the headers in `C_INCLUDE_PATH`.

`Meson` and `mbed TLS` are available as packages for most posix environments.

## Building

First configure a build directory:

```bash
$ meson buildrelease --buildtype=release
```

Then build using ninja:

```bash
$ ninja -C builddir
```

For further information see [Running Meson](https://mesonbuild.com/Running-Meson.html).

## Notes
Use _make.bat in Windows or Make.sh in linux to build ps3netsrv using POLARSSL library instead of mbed TLS and without Meson

12 changes: 12 additions & 0 deletions _make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off
cls

set PS3SDK=/c/PSDK3v2
set WIN_PS3SDK=C:/PSDK3v2
set PS3DEV=%PS3SDK%/ps3dev2
set PATH=%WIN_PS3SDK%/mingw/msys/1.0/bin;%WIN_PS3SDK%/mingw/bin;%PS3DEV%/ppu/bin;
set CYGWIN=nodosfilewarning

make clean
make -f Makefile all
pause
22 changes: 22 additions & 0 deletions include/AbstractFile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef __ABSTRACTFILE_H__
#define __ABSTRACTFILE_H__

#include <stdlib.h>
#include <stdint.h>
#include "compat.h"

class AbstractFile
{
public:
virtual ~AbstractFile() {}

virtual int open(const char *path, int flags) = 0;
virtual int close(void) = 0;
virtual ssize_t read(void *buf, size_t nbyte) = 0;
virtual ssize_t write(void *buf, size_t nbyte) = 0;
virtual int64_t seek(int64_t offset, int whence) = 0;
virtual int fstat(file_stat_t *fs) = 0;
};


#endif
Loading

0 comments on commit 3107bba

Please sign in to comment.