version 1.1.1.2, 2016/11/01 09:56:12
|
version 1.1.1.3, 2021/03/17 00:39:23
|
Line 51
|
Line 51
|
* GLOBAL VARIABLES |
* GLOBAL VARIABLES |
*/ |
*/ |
|
|
const PhysType gPhysTypes[] = { | const struct phystype *gPhysTypes[] = { |
#define _WANT_DEVICE_TYPES |
#define _WANT_DEVICE_TYPES |
#include "devices.h" |
#include "devices.h" |
NULL, |
NULL, |
Line 246 PhysGetUpperHook(Link l, char *path, char *hook)
|
Line 246 PhysGetUpperHook(Link l, char *path, char *hook)
|
int |
int |
PhysGetOriginate(Link l) |
PhysGetOriginate(Link l) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
return((pt && pt->originate) ? (*pt->originate)(l) : LINK_ORIGINATE_UNKNOWN); |
return((pt && pt->originate) ? (*pt->originate)(l) : LINK_ORIGINATE_UNKNOWN); |
} |
} |
Line 260 PhysGetOriginate(Link l)
|
Line 260 PhysGetOriginate(Link l)
|
int |
int |
PhysIsSync(Link l) |
PhysIsSync(Link l) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
return((pt && pt->issync) ? (*pt->issync)(l) : 0); |
return((pt && pt->issync) ? (*pt->issync)(l) : 0); |
} |
} |
Line 272 PhysIsSync(Link l)
|
Line 272 PhysIsSync(Link l)
|
int |
int |
PhysSetCallingNum(Link l, char *buf) |
PhysSetCallingNum(Link l, char *buf) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
if (pt && pt->setcallingnum) |
if (pt && pt->setcallingnum) |
return ((*pt->setcallingnum)(l, buf)); |
return ((*pt->setcallingnum)(l, buf)); |
Line 287 PhysSetCallingNum(Link l, char *buf)
|
Line 287 PhysSetCallingNum(Link l, char *buf)
|
int |
int |
PhysSetCalledNum(Link l, char *buf) |
PhysSetCalledNum(Link l, char *buf) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
if (pt && pt->setcallednum) |
if (pt && pt->setcallednum) |
return ((*pt->setcallednum)(l, buf)); |
return ((*pt->setcallednum)(l, buf)); |
Line 302 PhysSetCalledNum(Link l, char *buf)
|
Line 302 PhysSetCalledNum(Link l, char *buf)
|
int |
int |
PhysGetSelfName(Link l, char *buf, size_t buf_len) |
PhysGetSelfName(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 319 PhysGetSelfName(Link l, char *buf, size_t buf_len)
|
Line 319 PhysGetSelfName(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetPeerName(Link l, char *buf, size_t buf_len) |
PhysGetPeerName(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 336 PhysGetPeerName(Link l, char *buf, size_t buf_len)
|
Line 336 PhysGetPeerName(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetSelfAddr(Link l, char *buf, size_t buf_len) |
PhysGetSelfAddr(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 353 PhysGetSelfAddr(Link l, char *buf, size_t buf_len)
|
Line 353 PhysGetSelfAddr(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetPeerAddr(Link l, char *buf, size_t buf_len) |
PhysGetPeerAddr(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 370 PhysGetPeerAddr(Link l, char *buf, size_t buf_len)
|
Line 370 PhysGetPeerAddr(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetPeerPort(Link l, char *buf, size_t buf_len) |
PhysGetPeerPort(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 387 PhysGetPeerPort(Link l, char *buf, size_t buf_len)
|
Line 387 PhysGetPeerPort(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetPeerMacAddr(Link l, char *buf, size_t buf_len) |
PhysGetPeerMacAddr(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 404 PhysGetPeerMacAddr(Link l, char *buf, size_t buf_len)
|
Line 404 PhysGetPeerMacAddr(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetPeerIface(Link l, char *buf, size_t buf_len) |
PhysGetPeerIface(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 421 PhysGetPeerIface(Link l, char *buf, size_t buf_len)
|
Line 421 PhysGetPeerIface(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetCallingNum(Link l, char *buf, size_t buf_len) |
PhysGetCallingNum(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 455 PhysGetCallingNum(Link l, char *buf, size_t buf_len)
|
Line 455 PhysGetCallingNum(Link l, char *buf, size_t buf_len)
|
int |
int |
PhysGetCalledNum(Link l, char *buf, size_t buf_len) |
PhysGetCalledNum(Link l, char *buf, size_t buf_len) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
buf[0] = 0; |
buf[0] = 0; |
|
|
Line 472 PhysGetCalledNum(Link l, char *buf, size_t buf_len)
|
Line 472 PhysGetCalledNum(Link l, char *buf, size_t buf_len)
|
u_short |
u_short |
PhysGetMtu(Link l, int conf) |
PhysGetMtu(Link l, int conf) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
if (pt) { |
if (pt) { |
if (pt->getmtu) |
if (pt->getmtu) |
Line 495 PhysGetMtu(Link l, int conf)
|
Line 495 PhysGetMtu(Link l, int conf)
|
u_short |
u_short |
PhysGetMru(Link l, int conf) |
PhysGetMru(Link l, int conf) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
if (pt) { |
if (pt) { |
if (pt->getmru) |
if (pt->getmru) |
Line 532 PhysIsBusy(Link l)
|
Line 532 PhysIsBusy(Link l)
|
void |
void |
PhysShutdown(Link l) |
PhysShutdown(Link l) |
{ |
{ |
PhysType const pt = l->type; | const struct phystype *pt = l->type; |
|
|
MsgUnRegister(&l->pmsgs); |
MsgUnRegister(&l->pmsgs); |
|
|
Line 547 PhysShutdown(Link l)
|
Line 547 PhysShutdown(Link l)
|
void |
void |
PhysSetDeviceType(Link l, char *typename) |
PhysSetDeviceType(Link l, char *typename) |
{ |
{ |
PhysType pt; | const struct phystype *pt; |
int k; |
int k; |
|
|
/* Make sure device type not already set */ |
/* Make sure device type not already set */ |
Line 615 PhysMsg(int type, void *arg)
|
Line 615 PhysMsg(int type, void *arg)
|
*/ |
*/ |
|
|
int |
int |
PhysStat(Context ctx, int ac, char *av[], void *arg) | PhysStat(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Link const l = ctx->lnk; |
Link const l = ctx->lnk; |
|
|
|
(void)ac; |
|
(void)av; |
|
(void)arg; |
|
|
Printf("Device '%s' (%s)\r\n", l->name, (l->tmpl)?"template":"instance"); |
Printf("Device '%s' (%s)\r\n", l->name, (l->tmpl)?"template":"instance"); |
Printf("\tType : %s\r\n", l->type->name); |
Printf("\tType : %s\r\n", l->type->name); |