Page MenuHomeFreeBSD

rup: Add verions 4 from Sun
Needs ReviewPublic

Authored by bses30074_gmail.com on Jul 31 2024, 7:47 AM.
Tags
None
Referenced Files
F93314559: D46188.id141583.diff
Sun, Sep 8, 9:22 PM
F93312474: D46188.id141801.diff
Sun, Sep 8, 8:59 PM
F93307286: D46188.id141584.diff
Sun, Sep 8, 8:10 PM
F93261115: D46188.id.diff
Sun, Sep 8, 1:18 PM
Unknown Object (File)
Sat, Sep 7, 9:44 AM
Unknown Object (File)
Thu, Sep 5, 9:52 AM
Unknown Object (File)
Wed, Sep 4, 8:39 AM
Unknown Object (File)
Tue, Sep 3, 12:01 AM
Subscribers

Details

Reviewers
lwhsu
hrs
Summary
  1. Add version 4 structure (statsvar) in rstat.x. The new added structure has the similar members like the version 3 structure (statstime). The only difference is statsvar use len and pointer to represent the origin array member (cp_time and dk_xfer).

Also because of this, I can continue use union in "rstat_proc.c" because the member is not same as before. So I add stats_all_s4 variable.

  1. Use "netpath" with RPC function in rup and add version 4 RPC call.

Copmile

  1. cd /usr/src/include/rpcsvc && make all install // Header file
  2. cd /usr/src/lib/librpcsvc && make all install // Linker
  3. cd /usr/src/libexec/rpc.rstatd && make all install // RPC server
  4. cd /usr/src/usr.bin/rup && make all install // RPC client
Test Plan

I have test in localhost and in jail (for broadcast), from inetd to start from ourself. It seem it can work.

kola@freebsd:/usr/src/usr.bin/rusers $ sudo rup mytesthost
mytesthost      kola@freebsd:/usr/src/usr.bin/rusers $

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 58935
Build 55822: arc lint + arc unit

Event Timeline

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

It's newly added to rstat.x so you also need to build and install it, try make all install in src/include/rpcsvc?

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

It's newly added to rstat.x so you also need to build and install it, try make all install in src/include/rpcsvc?

Yes I have done it but still meet the problem. I should add my compile step in summary.

bses30074_gmail.com retitled this revision from rstat: Add verions 4 from Sun to rup: Add verions 4 from Sun.Aug 1 2024, 1:01 PM
bses30074_gmail.com edited the summary of this revision. (Show Details)

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

It's newly added to rstat.x so you also need to build and install it, try make all install in src/include/rpcsvc?

Yes I have done it but still meet the problem. I should add my compile step in summary.

Sorry, forgot that not only header files, you also need to rebuild and install librpcsvc under src/lib/librpcsvc, ld is actually looking for the symbol in that object.

bses30074_gmail.com edited the summary of this revision. (Show Details)

Test in localhost and jail