Skip to content

Commit 851215f

Browse files
committed
rename
1 parent 45d004c commit 851215f

File tree

12 files changed

+781
-781
lines changed

12 files changed

+781
-781
lines changed

uinet/example/main.c

Lines changed: 195 additions & 195 deletions
Large diffs are not rendered by default.

uinet/example/main_epoll.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int loop(void *arg)
6767
/* Handle new connect */
6868
if (events[i].data.fd == sockfd) {
6969
while (1) {
70-
int nclientfd = usp_accept(sockfd, NULL, NULL);
70+
int nclientfd = rsp_accept(sockfd, NULL, NULL);
7171
if (nclientfd < 0) {
7272
break;
7373
}
@@ -85,15 +85,15 @@ int loop(void *arg)
8585
if (events[i].events & EPOLLERR ) {
8686
/* Simply close socket */
8787
ff_epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
88-
usp_close(events[i].data.fd);
88+
rsp_close(events[i].data.fd);
8989
} else if (events[i].events & EPOLLIN) {
9090
char buf[256];
91-
size_t readlen = usp_read( events[i].data.fd, buf, sizeof(buf));
91+
size_t readlen = rsp_read( events[i].data.fd, buf, sizeof(buf));
9292
if(readlen > 0) {
93-
usp_write( events[i].data.fd, html, sizeof(html));
93+
rsp_write( events[i].data.fd, html, sizeof(html));
9494
} else {
9595
ff_epoll_ctl(epfd, EPOLL_CTL_DEL, events[i].data.fd, NULL);
96-
usp_close( events[i].data.fd);
96+
rsp_close( events[i].data.fd);
9797
}
9898
} else {
9999
printf("unknown event: %8.8X\n", events[i].events);
@@ -106,31 +106,31 @@ int main(int argc, char * argv[])
106106
{
107107
ff_init(argc, argv);
108108

109-
sockfd = usp_socket(AF_INET, SOCK_STREAM, 0);
109+
sockfd = rsp_socket(RSP_AF_INET, RSP_SOCK_STREAM, 0);
110110
printf("sockfd:%d\n", sockfd);
111111
if (sockfd < 0) {
112-
printf("usp_socket failed\n");
112+
printf("rsp_socket failed\n");
113113
exit(1);
114114
}
115115

116116
int on = 1;
117-
usp_ioctl(sockfd, FIONBIO, &on);
117+
rsp_ioctl(sockfd, FIONBIO, &on);
118118

119119
struct sockaddr_in my_addr;
120120
bzero(&my_addr, sizeof(my_addr));
121121
my_addr.sin_family = AF_INET;
122122
my_addr.sin_port = htons(80);
123123
my_addr.sin_addr.s_addr = htonl(INADDR_ANY);
124124

125-
int ret = usp_bind(sockfd, (struct usp_sockaddr *)&my_addr, sizeof(my_addr));
125+
int ret = rsp_bind(sockfd, (struct rsp_sockaddr *)&my_addr, sizeof(my_addr));
126126
if (ret < 0) {
127-
printf("usp_bind failed\n");
127+
printf("rsp_bind failed\n");
128128
exit(1);
129129
}
130130

131-
ret = usp_listen(sockfd, MAX_EVENTS);
131+
ret = rsp_listen(sockfd, MAX_EVENTS);
132132
if (ret < 0) {
133-
printf("usp_listen failed\n");
133+
printf("rsp_listen failed\n");
134134
exit(1);
135135
}
136136

uinet/freebsd/kern/pty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pty_modevent(module_t mod, int type, void *data)
192192
int tpdev_open(struct tty *tp, struct cdev *dev, int oflags);
193193

194194

195-
int usp_openpty(int *amaster, int *aslave, char *name)
195+
int rsp_openpty(int *amaster, int *aslave, char *name)
196196
{
197197
int error, fd_master,fd_slave;
198198
struct file *fp_master,*fp_slave;

uinet/lib/ff_api.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern "C" {
3939
#include "ff_event.h"
4040
#include "ff_errno.h"
4141

42-
#include "usp_socket.h"
42+
#include "rsp_socket.h"
4343

4444
struct linux_sockaddr {
4545
short sa_family;
@@ -97,8 +97,8 @@ enum FF_ROUTE_FLAG {
9797
* On error, -1 is returned, and errno is set appropriately.
9898
*/
9999
int ff_route_ctl(enum FF_ROUTE_CTL req, enum FF_ROUTE_FLAG flag,
100-
struct usp_sockaddr *dst, struct usp_sockaddr *gw,
101-
struct usp_sockaddr *netmask);
100+
struct rsp_sockaddr *dst, struct rsp_sockaddr *gw,
101+
struct rsp_sockaddr *netmask);
102102

103103
/* route api end */
104104

@@ -156,7 +156,7 @@ enum FF_NGCTL_CMD {
156156
int ff_ngctl(int cmd, void *data);
157157

158158

159-
int usp_pthread_create(char *name, pthread_t *thread, const pthread_attr_t *attr,
159+
int rsp_pthread_create(char *name, pthread_t *thread, const pthread_attr_t *attr,
160160
void *(*start_routine) (void *), void *arg);
161161

162162
/* internal api end */

uinet/lib/ff_dpdk_if.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ protocol_filter(const void *data, uint16_t len)
385385
static inline void
386386
handle_sysctl_msg(struct ff_msg *msg)
387387
{
388-
int ret = usp_sysctl(msg->sysctl.name, msg->sysctl.namelen,
388+
int ret = rsp_sysctl(msg->sysctl.name, msg->sysctl.namelen,
389389
msg->sysctl.old, msg->sysctl.oldlenp, msg->sysctl.new,
390390
msg->sysctl.newlen);
391391

@@ -400,15 +400,15 @@ static inline void
400400
handle_ioctl_msg(struct ff_msg *msg)
401401
{
402402
int fd, ret;
403-
fd = usp_socket(AF_INET, SOCK_DGRAM, 0);
403+
fd = rsp_socket(AF_INET, SOCK_DGRAM, 0);
404404
if (fd < 0) {
405405
ret = -1;
406406
goto done;
407407
}
408408

409-
ret = usp_ioctl_freebsd(fd, msg->ioctl.cmd, msg->ioctl.data);
409+
ret = rsp_ioctl_freebsd(fd, msg->ioctl.cmd, msg->ioctl.data);
410410

411-
usp_close(fd);
411+
rsp_close(fd);
412412

413413
done:
414414
if (ret < 0) {
@@ -456,20 +456,20 @@ static inline void
456456
handle_ipfw_msg(struct ff_msg *msg)
457457
{
458458
int fd, ret;
459-
fd = usp_socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
459+
fd = rsp_socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
460460
if (fd < 0) {
461461
ret = -1;
462462
goto done;
463463
}
464464

465465
switch (msg->ipfw.cmd) {
466466
case FF_IPFW_GET:
467-
ret = usp_getsockopt_freebsd(fd, msg->ipfw.level,
467+
ret = rsp_getsockopt_freebsd(fd, msg->ipfw.level,
468468
msg->ipfw.optname, msg->ipfw.optval,
469469
msg->ipfw.optlen);
470470
break;
471471
case FF_IPFW_SET:
472-
ret = usp_setsockopt_freebsd(fd, msg->ipfw.level,
472+
ret = rsp_setsockopt_freebsd(fd, msg->ipfw.level,
473473
msg->ipfw.optname, msg->ipfw.optval,
474474
*(msg->ipfw.optlen));
475475
break;

uinet/lib/ff_host_interface.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ int uhi_thread_create(uhi_thread_t *new_thread, struct uhi_thread_start_args *st
506506
}
507507

508508

509-
int usp_pthread_create(char *name, pthread_t *thread, const pthread_attr_t *attr,
509+
int rsp_pthread_create(char *name, pthread_t *thread, const pthread_attr_t *attr,
510510
void *(*start_routine) (void *), void *arg)
511511
{
512512
struct uhi_thread_start_args *tsa;
@@ -582,7 +582,7 @@ ff_realloc(void *p, unsigned long size)
582582
return (p);
583583
}
584584

585-
void *usp_malloc(unsigned long size)
585+
void *rsp_malloc(unsigned long size)
586586
{
587587
void *alloc;
588588

@@ -593,13 +593,13 @@ void *usp_malloc(unsigned long size)
593593
return (alloc);
594594
}
595595

596-
void *usp_calloc(unsigned long number, unsigned long size)
596+
void *rsp_calloc(unsigned long number, unsigned long size)
597597
{
598598
return (calloc(number, size));
599599
}
600600

601601

602-
void *usp_free(void *p)
602+
void *rsp_free(void *p)
603603
{
604604
free(p);
605605
}

uinet/lib/ff_host_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int _uhi_rwlock_wowned(uhi_rwlock_t *rw);
152152

153153
int sched_yield(void);
154154

155-
int usp_pthread_create(char *name, pthread_t *thread, const pthread_attr_t *attr,
155+
int rsp_pthread_create(char *name, pthread_t *thread, const pthread_attr_t *attr,
156156
void *(*start_routine) (void *), void *arg);
157157

158158

0 commit comments

Comments
 (0)