Skip to content

Implement ICP per RFC 165. #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15]
os: [ubuntu-22.04, ubuntu-24.04, macos-14, macos-15]
steps:
- uses: actions/checkout@v2
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ src/libncp.a
src/ping
src/finger
src/finser
src/telnet
test/*.log
5 changes: 4 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CFLAGS=-g -Wall

NCP=-L. -lncp

all: ncp ping finger finser
all: ncp ping finger finser telnet

ncp: ncp.o imp.o

Expand All @@ -18,3 +18,6 @@ finger: finger.o libncp.a

finser: finser.o libncp.a
$(CC) -o $@ $< $(NCP)

telnet: telnet.o libncp.a
$(CC) -o $@ $< $(NCP)
5 changes: 5 additions & 0 deletions src/imp.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ static void args (int argc, char **argv)
static void make_socket (void)
{
struct sockaddr_in source;
int enable = 1;

imp_sock = socket (AF_INET, SOCK_DGRAM, 0);
if (imp_sock == -1)
fatal ("socket");

if (setsockopt(imp_sock, SOL_SOCKET, SO_REUSEADDR,
&enable, sizeof enable) != 0)
fatal ("setsockopt(SO_REUSEADDR)");

source.sin_family = AF_INET;
source.sin_addr.s_addr = INADDR_ANY;
source.sin_port = port;
Expand Down
Loading
Loading