Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
426 commits
Select commit Hold shift + click to select a range
01df2cf
remove pdu memory allocations
EvanGee Jan 25, 2020
f1d0a76
Add frees in case of inpropper allocations
EvanGee Jan 29, 2020
12c5452
add allocation port functions
EvanGee Jan 29, 2020
37e5f89
Change name to get_header_from_mib
EvanGee Feb 1, 2020
127c954
Add memory failurehandling
EvanGee Feb 1, 2020
9dfacd6
change/limit client parameteres
EvanGee Feb 1, 2020
04f1a04
moved all client cleanup to single function
EvanGee Feb 1, 2020
306d563
add some error prevention
EvanGee Feb 1, 2020
4f2a866
add ip converting function
EvanGee Feb 1, 2020
16f7f7f
add propper server ip binding, and harden tasks
EvanGee Feb 1, 2020
9210397
Missed this
EvanGee Feb 1, 2020
cdaf2dd
split process header function
EvanGee Feb 9, 2020
048f085
Merge pull request #7 from EvanGee/refactoring
EvanGee Feb 9, 2020
7f623e4
change LV memory allocations
EvanGee Feb 21, 2020
f04b911
WIP writing Messages to files
EvanGee Feb 21, 2020
6dbb10d
working on writing state
EvanGee Feb 28, 2020
ac050d4
add save proxy message
EvanGee Mar 24, 2020
ebf788a
raed and write messages, still not working
EvanGee Mar 25, 2020
2ee2eb3
Save and get requests work
EvanGee Mar 26, 2020
4d0c2ac
Add save_file function
EvanGee Apr 1, 2020
bc0e650
add save_file
EvanGee Apr 2, 2020
7eae1af
add tests
EvanGee Apr 3, 2020
0b11a37
finish file journaling tests
EvanGee Apr 11, 2020
c8a1625
fix compiler warnings
EvanGee Apr 11, 2020
1d0b70e
Merge pull request #8 from EvanGee/refactoring
EvanGee Apr 11, 2020
57843a3
Add config
EvanGee Apr 12, 2020
19d9478
add save to timeout
EvanGee Apr 22, 2020
1489d92
remove req->procedure == none from on-server_time_out
EvanGee Apr 22, 2020
72d00b2
add message cont part request
EvanGee May 3, 2020
168abdf
add create message functions and testing
EvanGee May 5, 2020
6195973
fix up before re-branching
EvanGee May 9, 2020
b26b8c8
change headers
EvanGee May 9, 2020
b485d3c
remove packet data len
EvanGee May 9, 2020
ef1ebb4
add mtu field
EvanGee May 9, 2020
98a54fc
clean up packets
EvanGee May 9, 2020
e1fe62f
clean up tests
EvanGee May 9, 2020
0e25b7a
moved functions
EvanGee May 13, 2020
927af38
change function to drivers
EvanGee May 16, 2020
2e5ce71
Change init request to re-use buffer
EvanGee May 16, 2020
db0c15c
better error handling in task
EvanGee May 16, 2020
48453a0
change file saving/getting location
EvanGee May 16, 2020
63f7ce6
change network types
EvanGee May 16, 2020
1811de4
fix tcp server
EvanGee May 16, 2020
719bd09
add count(parse size) to on_recv_server_callback
EvanGee May 16, 2020
c574ce8
seperate csp and posix servers
EvanGee May 20, 2020
22f78c4
removing unused headers
EvanGee May 21, 2020
2c00070
remove more unessary includes
EvanGee May 22, 2020
aaa29ea
more moving stuff
EvanGee May 22, 2020
9ef118e
moving more header files around, and include guards
EvanGee May 23, 2020
5120080
update tests
EvanGee May 23, 2020
34f7a36
remove comments
EvanGee May 23, 2020
66744b7
add test support files
EvanGee May 23, 2020
6792a92
add to git ignore
EvanGee May 23, 2020
bf1fd4a
merge
EvanGee May 23, 2020
471f0a9
make sure it works on first go
EvanGee May 23, 2020
6b9190f
update readme
EvanGee May 25, 2020
e372824
Update README.md
EvanGee May 25, 2020
ee85354
Update README.md
EvanGee May 25, 2020
cc962b2
Update README.md
EvanGee May 25, 2020
7236385
Update README.md
EvanGee May 25, 2020
c4dacb0
update readme
EvanGee May 26, 2020
5519db6
Update README.md
EvanGee May 26, 2020
3895daa
Update README.md
EvanGee May 26, 2020
a2572ad
Update README.md
EvanGee May 26, 2020
a72040f
remove stdint dependency
EvanGee May 28, 2020
9005e1a
Merge branch 'master' of https://github.com/EvanGee/CCSDS_FileDeliver…
EvanGee May 28, 2020
21b1a03
more basic cleanup
EvanGee May 29, 2020
6f55e8a
add working connection csp
EvanGee Jun 1, 2020
d14aebc
update mib.txt
EvanGee Jun 3, 2020
c54d3a6
remove undeed experiment stdint
EvanGee Jun 3, 2020
8265c1f
cleanup if statements
EvanGee Jun 3, 2020
9014525
Change port, will need to flush out functions in future
EvanGee Jun 3, 2020
b8315e5
add read and write lv
EvanGee Jun 6, 2020
7af27bb
incorporate write_lv
EvanGee Jun 6, 2020
51c85de
incorporate read_lv
EvanGee Jun 6, 2020
4397946
Turn partial request into scheduled request
EvanGee Jun 7, 2020
97b49ca
Add continue partial functionality
EvanGee Jun 9, 2020
6e844f3
Fix memory cleanup on error, add better tests
EvanGee Jun 13, 2020
e3d77f3
fix some unit test stuff
EvanGee Jun 13, 2020
0f94a47
add directories to partial requests
EvanGee Jun 16, 2020
cc62dea
Fix Nak bug, where datapackets were stack smashing if NAK was too big
EvanGee Jun 27, 2020
70ff7f5
get_file_name now makes directories if they don't exist
EvanGee Jul 3, 2020
92b495d
add initate all scheduled requests
EvanGee Jul 6, 2020
aad2641
Scheduling put request
EvanGee Jul 13, 2020
dbc4f5f
move read_dir to port
EvanGee Jul 16, 2020
b5ff795
add 'new' put request framework, remove old one?
EvanGee Jul 16, 2020
fe5eb7e
refacator request functions
EvanGee Jul 22, 2020
3416be7
strengthen error reporting for threads
EvanGee Jul 22, 2020
3607379
fix printf bug
EvanGee Jul 23, 2020
9873f0b
Merge pull request #11 from EvanGee/change_start_req
EvanGee Jul 23, 2020
402673f
master update to work with satsim
EvanGee Jul 24, 2020
80d6495
new csp changes
EvanGee Jul 24, 2020
0de8f92
Moved the necessary stuff for scheduling a request to a user function
EvanGee Aug 8, 2020
b8dc607
Delete requests from filesystem when they are successfully finished
EvanGee Aug 8, 2020
0a0450b
change message on timeout for un acked requests
EvanGee Aug 8, 2020
4f54cf6
create generic server provider to just use queues
EvanGee Aug 22, 2020
c852bf7
Add generic server boilerplate
EvanGee Aug 23, 2020
16a691b
add generic queue handlers
EvanGee Aug 26, 2020
6b7edea
Merge branch 'master' into change_start_req
EvanGee Aug 29, 2020
bcfc0da
Merge pull request #12 from EvanGee/change_start_req
EvanGee Aug 29, 2020
d7b66fb
fuck externs
EvanGee Nov 26, 2020
7cc9023
update to change code to be sat build complient
EvanGee Nov 27, 2020
24c3d17
add some compiler guards so code composer doesn't auto compile
EvanGee Nov 27, 2020
599f79f
make master work with CCS, just don't include posix in build
EvanGee Jan 16, 2021
70c7e4e
I don't know why this happened, but I can't change the permissions
EvanGee Jan 16, 2021
bd7192c
Merge branch 'master' of https://github.com/EvanGee/CCSDS_FileDeliver…
EvanGee Jan 16, 2021
3eca3c7
missing curly braces, add port to before header guard
EvanGee Jan 16, 2021
9fb9e79
add default peer file for sat
EvanGee Jan 17, 2021
c2f5ce1
add remove dir port
EvanGee Jan 17, 2021
1fed18d
Remove portable wrapping functions in favor of macro definitions
EvanGee Jan 20, 2021
b65c505
change some syntax (remove multiple definitions)
EvanGee Jan 20, 2021
199c57c
Add necessary RED_FS function wrappers
EvanGee Jan 20, 2021
62ccc5d
fix dirname
EvanGee Jan 20, 2021
bf43ca8
Compiles
EvanGee Jan 20, 2021
04e90bc
Change priority of task to actually run
EvanGee Jan 30, 2021
30269ea
Add temperary task functions
EvanGee Jan 30, 2021
e18b073
add reliance edge function headers and some port stuff
EvanGee Jan 30, 2021
90656c2
Change read_json to use alloc
EvanGee Jan 30, 2021
01a2f8c
Moving all allocations inside of a thread/task context. For Ti compiler
EvanGee Jan 31, 2021
9550922
improve csp error handling, and remove VLA
EvanGee Feb 2, 2021
cf86367
add htonl functions on build_pdu_header and process_pdu_header
EvanGee Feb 2, 2021
af5b894
add bit print function
EvanGee Feb 3, 2021
6312e5b
testing pdu_handler functions
EvanGee Feb 3, 2021
5dd3571
big change to protocol building and parsing, starting with pdu header
EvanGee Feb 5, 2021
e7b5770
Metadata packets refactoring
EvanGee Feb 12, 2021
da197eb
add new LV functions for big endian ID parsing
EvanGee Feb 13, 2021
d4ac3f9
add propper big endian messages that contain IDs
EvanGee Feb 13, 2021
0da5140
refactor 'ack' packet
EvanGee Feb 15, 2021
8bfdbf2
refactor eof packet
EvanGee Feb 18, 2021
a3226ca
refactor data_packet, need to write parse_data_packet unit test
EvanGee Feb 18, 2021
ce85328
add process_data_packet test
EvanGee Feb 19, 2021
432d9c0
decouple data_packet and change endianess of NAKS
EvanGee Feb 20, 2021
575b3da
Add new nak packet and parsing functions
EvanGee Feb 21, 2021
f782e43
add client_recv_nak_test
EvanGee Feb 25, 2021
8758f8a
add new and improved NAK response for client
EvanGee Feb 26, 2021
c2a0463
add refactored incomplete finished pdu
EvanGee Feb 27, 2021
eda8396
remove old function for naks
EvanGee Feb 27, 2021
09dd00f
change some print statements, and include configs for ground
EvanGee Feb 28, 2021
da458f4
change some print statements to print llu
EvanGee Feb 28, 2021
7ede482
remove uncessary enums
EvanGee Feb 28, 2021
5746cdd
Sanitize request memory
EvanGee Mar 4, 2021
7c8dc75
add some error handling
EvanGee Mar 6, 2021
8d91b69
change message types to use uint64_t ids
EvanGee Mar 10, 2021
2dc5054
better error haling for creating packets. id length
EvanGee Mar 11, 2021
00163e9
going through protocol handler unit tests
EvanGee Mar 11, 2021
05312cb
repair data_packet, fix checksum function, add tests
EvanGee Mar 11, 2021
eacc2de
fix mib bug, id sizes and seq num sizes need to be predefined
EvanGee Mar 12, 2021
f525d47
set client-> close to false on init (TI problems)
EvanGee Mar 12, 2021
577be3e
improve ssp_alloc
EvanGee Mar 12, 2021
fc1c658
fix list
EvanGee Mar 13, 2021
3fd25fb
change some logging
EvanGee Mar 13, 2021
265067a
switch checksum to calculate using network byte order
EvanGee Mar 13, 2021
3a5950e
add one more network byte conversion to calc checksum
EvanGee Mar 13, 2021
697f8b5
fix checksums for big endian
EvanGee Mar 13, 2021
094926f
change name of task file, and move some stuff around
EvanGee Mar 13, 2021
1ceb4db
Change logging and move stuff around
EvanGee Mar 13, 2021
25e73d2
fix some compiler warnings
EvanGee Mar 14, 2021
6655a63
make an init_client function for ez of testing and readibility
EvanGee Mar 14, 2021
10815de
need to change linked list to -1 errors
EvanGee Mar 14, 2021
615797b
add new revised receive_offset function
EvanGee Mar 20, 2021
5cfa445
fix one off error for naks
EvanGee Mar 21, 2021
8510506
remove ssp_ntohl func
EvanGee Mar 21, 2021
8ca3118
46 bit transaction id
EvanGee Mar 21, 2021
bf752e1
change network
EvanGee Mar 23, 2021
d1bbcef
change network
EvanGee Mar 23, 2021
b5accf8
update csp server
EvanGee Mar 25, 2021
3f80c44
update csp server
EvanGee Mar 25, 2021
dfa1741
make it so when a request times out, it goes back to 'accept'. One clien
EvanGee Mar 27, 2021
6574dec
close connection if no packets received after data burst
EvanGee Mar 27, 2021
3d5501d
fix bug where extra client is started
EvanGee Mar 28, 2021
6e4f288
fix bug where request was not started
EvanGee Mar 28, 2021
f1dbebf
add get_request, reset timeout after data_burst
EvanGee Mar 28, 2021
d055d77
close connection if timeout (aka no active requests)
EvanGee Mar 28, 2021
0bb9a65
whoops, need pointer
EvanGee Mar 28, 2021
bc12c07
change get request return to default
EvanGee Mar 29, 2021
23ddb93
todo, get rid of stdin
EvanGee Mar 30, 2021
73a91f8
Update main with some daemonization
EvanGee Mar 31, 2021
d581a71
update request documentation
EvanGee Apr 7, 2021
5be5757
remove stdin callback
EvanGee Apr 7, 2021
b87da32
csp puse async_nak timout for timeout interval
EvanGee Apr 9, 2021
737f810
change new keyword bug
EvanGee Apr 9, 2021
c606ee0
oops forgot to add header file
EvanGee Apr 9, 2021
b038521
update readme
EvanGee Apr 10, 2021
d242e66
add documents
EvanGee Apr 10, 2021
ead712c
change port for ex2 build
EvanGee Apr 10, 2021
e8f31b5
update to working version
EvanGee Apr 11, 2021
44372df
add new json parsing for saved meta data
EvanGee May 15, 2021
905a5fc
Merge branch 'ex2_ftp' of github.com:EvanGee/CCSDS_FileDeliveryProtoc…
EvanGee May 15, 2021
ae4912e
update way files are saved
EvanGee May 23, 2021
c2a7875
change filesystem and request tests
EvanGee May 23, 2021
8f9cc29
add close function to exit out of current request
EvanGee May 27, 2021
0125f80
moved if to switch
EvanGee May 29, 2021
c9fa4c3
Add continue partial file function
EvanGee May 29, 2021
2a3efdb
Merge pull request #13 from EvanGee/merge_from_ex2_to_master
EvanGee Jun 4, 2021
dc17b0b
update port.h
EvanGee Jun 8, 2021
8c7c703
remove test comments
EvanGee Jun 8, 2021
e98918f
Merge pull request #14 from EvanGee/merge_from_ex2_to_master
EvanGee Jun 8, 2021
64917df
remove permissions for red_open
EvanGee Jun 8, 2021
213a7c8
fix some compiler warnings
EvanGee Jun 9, 2021
df338f4
add configured libcsp lib
EvanGee Jun 9, 2021
a2b5b9a
add ramdom sequence number start
EvanGee Jun 15, 2021
f22602a
mod 255 for transaction number start
EvanGee Jun 15, 2021
fcbbed8
Merge pull request #15 from EvanGee/ground_station_build
EvanGee Jun 24, 2021
1d760c4
add tests and truncate
EvanGee Jun 24, 2021
47511a3
start request on get request
EvanGee Jun 24, 2021
3aeebb3
update gitignore
wagnerd97 Jun 25, 2021
a6f68a0
remove libcsp
EvanGee Jul 5, 2021
513f938
add safe_strncpy to utils
EvanGee Jul 8, 2021
de8e03b
add 'onExit' callback to clients
EvanGee Jul 8, 2021
1ab730c
reduce nak timer
EvanGee Jul 8, 2021
d4eec23
general 'main' client
EvanGee Jul 8, 2021
d5e0356
add taskDelete to client thread cleanup
EvanGee Jul 8, 2021
f9d5ea3
change round trip allowance
EvanGee Jul 8, 2021
7fb261d
reduce round trip allowance
EvanGee Jul 8, 2021
1add6af
merge conflict
EvanGee Jul 8, 2021
013c9d5
make client tasks spin in freeRTOS
EvanGee Jul 9, 2021
d14c2ae
Merge branch 'master' of https://github.com/EvanGee/CCSDS_FileDeliver…
EvanGee Jul 9, 2021
6f64804
Merge pull request #17 from wagnerd97/update_gitignore
EvanGee Jul 9, 2021
3ad2f52
fix some timeout issues
EvanGee Jul 19, 2021
250f3ed
Merge branch 'master' of github.com:EvanGee/CCSDS_FileDeliveryProtocol
EvanGee Jul 19, 2021
bdb5956
add 'closing connection' message
EvanGee Jul 20, 2021
db75e71
Merge branch 'master' of https://github.com/EvanGee/CCSDS_FileDeliver…
EvanGee Jul 21, 2021
a4515db
fix client Delete crash
EvanGee Jul 21, 2021
5319961
fix task delete crash
EvanGee Jul 21, 2021
39696cf
spin lock for clients to wait until app is ready
EvanGee Jul 24, 2021
3b466bd
quality of life, and add timeout to csp server
EvanGee Jul 24, 2021
aac7e9a
change deliminator, add TODO
EvanGee Jul 24, 2021
ab0c8d3
merge_conflict
EvanGee Jul 24, 2021
97f5c9b
Add locking functions
EvanGee Aug 2, 2021
ddc04c7
basic locking for continuous csp RTOS tasks
EvanGee Aug 2, 2021
5575ffc
Merge branch 'master' of https://github.com/EvanGee/CCSDS_FileDeliver…
EvanGee Aug 8, 2021
a720972
add binary semiphore
EvanGee Aug 9, 2021
2d9b597
add logging function
EvanGee Aug 15, 2021
13c4c2c
update logging
EvanGee Aug 15, 2021
3346d37
improve posix logging
EvanGee Aug 15, 2021
023d32c
add python bindings plus debug statement
EvanGee Aug 20, 2021
ae88c77
add sleep
EvanGee Sep 20, 2021
f36dac1
Update ReadMe
EvanGee Sep 20, 2021
1faccf8
update README
EvanGee Sep 20, 2021
cec6729
another one
EvanGee Sep 20, 2021
56351c5
update readme
EvanGee Sep 30, 2021
78e5884
Add submodules, plz don't break exalta
EvanGee Sep 30, 2021
9b8193c
add diff?
EvanGee Sep 30, 2021
9bd7bf2
update readme
EvanGee Sep 30, 2021
68e3f05
rename build instructions
EvanGee Sep 30, 2021
8d859b6
update readme with log instructions
EvanGee Sep 30, 2021
314cc41
set lock to open on init
EvanGee Sep 30, 2021
0e88357
delete weird old file
EvanGee Sep 30, 2021
451baf7
delete other file
EvanGee Sep 30, 2021
0041546
Update README.md
EvanGee May 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Program/src/*.o
main
settings.json
SpaceProjects.odt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this included? It's part of the repo, so seems to belong. Maybe this is to ensure it stays in the Documents folder? If so, no problem.

Copy link
Owner Author

@EvanGee EvanGee Jun 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be fixed by the 'negative pattern' I spoke about above ^^

Program/src/incomplete_requests
Program/src/obj
Program/test/incomplete_requests
Program/test/temp

*.o
*.a
TODO
Program/FreeRTOSv10.2.1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could wildcard; Program/FreeRTOS*

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea, also, I suppose I could remove the .gitingore entirely from the repo.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not get rid of .gitignore as it's painful to always be checking you aren't committing crud into a repo. I like to have only those things that are needed. So, like the build files that always change, keep useless crud out, right?

Copy link
Owner Author

@EvanGee EvanGee Jun 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we may want to use a negative pattern? Like ignore all, then explicitly not ignore things we want to keep. what do you think? that way it doesn't need to change depending on who is using it. --if someone has a different IDE for example, and wants to add their own additions to a .gitignore.

Program/libcsp
.vscode*
*.jpg
*.jpeg
.gitignore

give_packet_loss.sh
Program/libcsp
Program/__pycache__
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Program/libcsp"]
path = Program/libcsp
url = git@github.com:EvanGee/libcsp.git
Binary file added Documents/Design.pdf
Binary file not shown.
Binary file added Documents/ImplementorsGuide.pdf
Binary file not shown.
Binary file added Documents/MostRecentRatifications.pdf
Binary file not shown.
Binary file added Documents/SpaceProjects.odt
Binary file not shown.
80 changes: 80 additions & 0 deletions Documents/mib.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
The MIB is known as the management information base.
This base holds the configuration information for users (peers or applications).
This data is used for determining how and who we can send file or commands
to. Files will not be sent to users that are not included in the MIB.

The MIB is currently configured as key value pairs. These pairs are formatted
in the JSON format.

Here is an example of a MIB entry:
{
"cfdp_id": 1,
"UT_address" : 2130706433,
"UT_port" : 1111,
"type_of_network" : 1,
"default_transmission_mode" : 1,
"MTU" : 1500,
"one_way_light_time" : 123,
"total_round_trip_allowance" : 123,
"async_NAK_interval" : 123,
"async_keep_alive_interval" : 123,
"async_report_interval" : 123,
"immediate_nak_mode_enabled" : 123,
"prompt_transmission_interval" : 123,
"disposition_of_incomplete" : 123,
"CRC_required" : 0,
"keep_alive_discrepancy_limit" : 8,
"positive_ack_timer_expiration_limit" : 123,
"nak_timer_expiration_limit" : 123,
"transaction_inactivity_limit" : 123
}


Below are the meanings of the fields for the MIB

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this list complete?


- cfdp_id
This is the unique identifier of a peer on the network. We can start it at 1
and increment it from there. This is an unsigned integer (32 bit) value;

- UT_address
This is an Underlying Transmission address. For example, in an IP stack, this
would be an IP4 Ip address. This value is a decimal representation of an IP
address. This particular one is 127.0.0.1.

- UT_port
This os an Underlying Transmission port. For example, in an IP stack, this
would be a 16 bit value -- like port 8080. combined with the UT_address,
together they form a complete UT address. The one above would be equal to
127.0.0.1:1111. This is an unsigned integer (16 bit) value

- type_of_network
This number represents what type of network the underlying UT address takes.
currently, the only acceptable values are 0 and 1.
- 0: UDP
- 1: TCP
- 2: csp

- default_transmission_mode:
not implemented

- MTU
This number represents the 'maximum transmissible unit' -- this will also
take the form of a buffer in the program. This value is the maximum size
packet that the application will receive.

- one_way_light_time : not implemented
- total_round_trip_allowance : not implemented
- async_NAK_interval : not implemented
- async_keep_alive_interval : not implemented
- async_report_interval : not implemented
- immediate_nak_mode_enabled : not implemented
- prompt_transmission_interval : not implemented
- disposition_of_incomplete : not implemented
- CRC_required : not implemented
- keep_alive_discrepancy_limit : not implemented
- positive_ack_timer_expiration_limit : not implemented
- nak_timer_expiration_limit : not implemented
- transaction_inactivity_limit : not implemented

if you want to get in contact with me
email me at evangiese77@gmail.com
Empty file added Program/__init__.py
Empty file.
59 changes: 59 additions & 0 deletions Program/ftp_python.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import subprocess
from pprint import pprint
import os
import datetime

def change_working_dir():
path = os.path.abspath(__file__)
split = path.split("/")[0:-1]
split.append("src")
new_path = "/".join(split)
os.chdir(new_path)


class logger():
def __init__(self, path="ftp_log/log.txt"):
self.log_file = self.create_ftp_log(path)

def create_ftp_log(self, path):
if not os.path.exists("ftp_log"):
os.makedirs("ftp_log")

file = open(path, "a")
return file

def close(self):
self.log_file.close()

def log(self, stuff):
self.log_file.writelines(str(datetime.datetime.today()) + ":" + stuff)

def get_request(sat_path, file_path, block=True):
change_working_dir()

print("need sudo password for opening /dev/ttyUSB0")
cmd = ["sudo", "./main", "-i", "10", "-c", "1", "-k", "/dev/ttyUSB0", "-f", 'GET {0}|{1}'.format(sat_path, file_path)]

if block:
output = subprocess.run(cmd)
print(output)
return

#subprocess.Popen(cmd)

def put_request(file_path, sat_path, block=True):
change_working_dir()

print("need sudo password for opening /dev/ttyUSB0")
cmd = ["sudo", "./main", "-i", "10", "-c", "1", "-k", "/dev/ttyUSB0", "-f", 'PUT {0}|{1}'.format(file_path, sat_path)]

if block:
output = subprocess.run(cmd)
print(output)
return

#subprocess.Popen(cmd)


if __name__ == "__main__":
print("thats not how you use this, please import either 'get_request' or 'put_request' into your program")
31 changes: 31 additions & 0 deletions Program/include/app_control.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*------------------------------------------------------------------------------
This file is protected under copyright. If you want to use it,
please include this text, that is my only stipulation.

Author: Evan Giese
------------------------------------------------------------------------------*/
#ifndef SSP_TASKS_H
#define SSP_TASKS_H

#include "types.h"

void ssp_cleanup_client(Client *client);
void ssp_cleanup_req(void *request);
void ssp_cleanup_ftp(FTP *app);
void *ssp_connectionless_server_task(void *params);
void *ssp_connectionless_client_task(void* params);

void *ssp_connection_client_task(void *params);
void *ssp_connection_server_task(void *params);
void *ssp_csp_connectionless_client_task(void *params);
void *ssp_csp_connectionless_server_task(void *params);
void *ssp_csp_connection_client_task(void *params);
void *ssp_csp_connection_server_task(void *params);
void ssp_client_join(Client *client);
void *ssp_generic_client_task(void *params);
void *ssp_generic_server_task(void *params);

void reset_timeout(int *prevtime);
void remove_request_check(Node *node, void *request, void *args);

#endif
1 change: 1 addition & 0 deletions Program/include/changeNotes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
added PDU_NAK_METADATA directive, due to spec not containing room for missing metadata packet
39 changes: 39 additions & 0 deletions Program/include/csp_server_provider.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*------------------------------------------------------------------------------

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere the guidelines for comments and such are not being followed. See ex2_eps

This file is protected under copyright. If you want to use it,
please include this text, that is my only stipulation.

Author: Evan Giese
------------------------------------------------------------------------------*/
#ifndef CSP_SERVER_H
#define CSP_SERVER_H
#include "stdint.h"

void csp_connectionless_client(uint8_t dest_id, uint8_t dest_port, uint8_t src_port, uint32_t packet_len,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every prototype should be documented.

int (*onSend)(int sfd, void *addr, uint32_t size_of_addr, void *onSendParams),
int (*onRecv)(int sfd, char *packet, uint32_t packet_len, uint32_t *buff_size, void *addr, size_t size_of_addr, void *onRecvParams) ,
int (*checkExit)(void *checkExitParams),
void (*onExit)(void *params),
void *params);

void csp_connectionless_server(uint8_t my_port, uint32_t packet_len, uint32_t time_out,
int (*onRecv)(int sfd, char *packet, uint32_t packet_len, uint32_t *buff_size, void *addr, size_t size_of_addr, void *other),
int (*onTimeOut)(void *other),
int (*checkExit)(void *other),
void (*onExit)(void *other),
void *other);

void csp_connection_server(uint8_t my_port, uint32_t packet_len, uint32_t time_out,
int (*onRecv)(int sfd, char *packet, uint32_t packet_len, uint32_t *buff_size, void *addr, size_t size_of_addr, void *other),
int (*onTimeOut)(void *other),
int (*checkExit)(void *other),
void (*onExit)(void *other),
void *other);

void csp_connection_client(uint8_t dest_id, uint8_t dest_port, uint8_t my_port, uint32_t packet_len, uint32_t time_out, void*lock,
int (*onSend)(int sfd, void *addr, uint32_t size_of_addr, void *onSendParams),
int (*onRecv)(int sfd, char *packet, uint32_t packet_len, uint32_t *buff_size, void *addr, size_t size_of_addr, void *onRecvParams) ,
int (*checkExit)(void *checkExitParams),
void (*onExit)(void *params),
void *params);
int csp_custom_ftp_ping(uint32_t dest_id, uint32_t port);
#endif
18 changes: 18 additions & 0 deletions Program/include/file_delivery_app.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*------------------------------------------------------------------------------
This file is protected under copyright. If you want to use it,
please include this text, that is my only stipulation.

Author: Evan Giese
------------------------------------------------------------------------------*/
#ifndef FTP_APP_H
#define FTP_APP_H
#include "types.h"

int init_ftp(uint32_t my_cfdp_address, FTP *app);
Client *ssp_client(uint32_t cfdp_id, FTP *app);
void create_ssp_server(FTP *app);
int create_ssp_server_drivers(FTP *app);
void *create_ftp_task(uint32_t cfdp_id, FTP *app);
Client *init_client(uint32_t dest_cfdp_id, uint32_t my_cfdp_id);

#endif
54 changes: 54 additions & 0 deletions Program/include/filesystem_funcs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*------------------------------------------------------------------------------
This file is protected under copyright. If you want to use it,
please include this text, that is my only stipulation.

Author: Evan Giese
------------------------------------------------------------------------------*/
#ifndef FILESYSTEM_FUNCS_H
#define FILESYSTEM_FUNCS_H
#include "types.h"

#define TEMP_FILESIZE 1000

struct params {
int error;
int fd;
};


int get_file_size(char *source_file_name);

//allocates space for a file pointer
File *create_file(char *source_file_name, int clear_file_contents);
void ssp_free_file(void *file);
int add_first_offset(File *file, uint32_t file_size);

int does_file_exist(char *source_file_name);
int get_offset(File *file, void *buff, uint32_t buf_size, int offset);
int write_offset(File *file, void *buff, uint32_t size, uint32_t offset);
uint32_t calc_check_sum(char *data, uint32_t length);
uint32_t check_sum_file(File *file, uint16_t stack_buffer);
int receive_offset(File *file, uint32_t offset_start, uint32_t offset_end);
File *create_temp_file(char *file_name, uint32_t size);
int change_tempfile_to_actual(char *temp, char *destination_file_name, uint32_t file_size, File *file);
int read_json(char *file_name, int (*callback)(char *key, char *value, void *params), void *params);

int write_lv(int fd, LV lv);
int read_lv(int fd, LV *lv);

int read_id(int fd, uint64_t *id);
int write_id(int fd, uint64_t id);

int save_req_to_file(Request *req);
int save_file_to_file(int fd, File *file);
int get_file_from_file(int fd, File *file);
int get_req_from_file(uint32_t dest_cfdp_id, uint64_t transaction_seq_num, uint32_t my_cfdp_id, Request *req);
int delete_saved_request(Request *req);
int read_request_from_file(int fd, Request *req);


//new json stuff:
int write_request_json (Request *req, char *file_name);
int get_request_from_json (Request *req, char *file_name);

#endif
19 changes: 19 additions & 0 deletions Program/include/generic_server_provider.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef SSP_GENERIC_PROVIDER_H
#define SSP_GENERIC_PROVIDER_H
#include "port.h"

void csp_generic_server(
int (*onRecv)(int sfd, char *packet, uint32_t packet_len, uint32_t *buff_size, void *addr, size_t size_of_addr, void *app),
int (*onTimeOut)(void *app),
int (*checkExit)(void *app),
void (*onExit)(void *app),
void *app);

void csp_generic_client(uint8_t dest_id, uint8_t dest_port, uint8_t my_port, uint32_t packet_len,
int (*onSend)(int sfd, void *addr, uint32_t size_of_addr, void *onSendParams),
int (*onRecv)(int sfd, char *packet, uint32_t packet_len, uint32_t *buff_size, void *addr, size_t size_of_addr, void *onRecvParams) ,
int (*checkExit)(void *checkExitParams),
void (*onExit)(void *params),
void *params);

#endif
Loading