Wed Jan 8 2020 09:50:17

Asterisk developer's documentation


pktccops.h File Reference

PacketCable COPS. More...

Go to the source code of this file.

Data Structures

struct  cops_gate
 

Enumerations

enum  { GATE_SET, GATE_INFO, GATE_SET_HAVE_GATEID, GATE_DEL }
 
enum  {
  GATE_ALLOC_FAILED, GATE_ALLOC_PROGRESS, GATE_ALLOCATED, GATE_CLOSED,
  GATE_CLOSED_ERR, GATE_OPEN, GATE_DELETED, GATE_TIMEOUT
}
 

Functions

struct cops_gateast_pktccops_gate_alloc (int cmd, struct cops_gate *gate, uint32_t mta, uint32_t actcount, float bitrate, uint32_t psize, uint32_t ssip, uint16_t ssport, int(*const got_dq_gi)(struct cops_gate *gate), int(*const gate_remove)(struct cops_gate *gate))
 

Detailed Description

PacketCable COPS.

Author
Attila Domjan attil.nosp@m.a.do.nosp@m.mjan..nosp@m.hu@g.nosp@m.mail..nosp@m.com

Definition in file pktccops.h.

Enumeration Type Documentation

anonymous enum
Enumerator
GATE_SET 
GATE_INFO 
GATE_SET_HAVE_GATEID 
GATE_DEL 

Definition at line 35 of file pktccops.h.

anonymous enum
Enumerator
GATE_ALLOC_FAILED 
GATE_ALLOC_PROGRESS 
GATE_ALLOCATED 
GATE_CLOSED 
GATE_CLOSED_ERR 
GATE_OPEN 
GATE_DELETED 
GATE_TIMEOUT 

Definition at line 42 of file pktccops.h.

Function Documentation

struct cops_gate* ast_pktccops_gate_alloc ( int  cmd,
struct cops_gate gate,
uint32_t  mta,
uint32_t  actcount,
float  bitrate,
uint32_t  psize,
uint32_t  ssip,
uint16_t  ssport,
int(*)(struct cops_gate *gate)  got_dq_gi,
int(*)(struct cops_gate *gate)  gate_remove 
)

Definition at line 470 of file res_pktccops.c.

References ast_debug, ast_log(), cops_gate_cmd(), cops_gate::gate_remove, GATE_SET_HAVE_GATEID, cops_gate::gateid, cops_gate::got_dq_gi, LOG_WARNING, and pktcreload.

Referenced by mgcp_alloc_pktcgate(), and mgcp_hangup().

475 {
476  while (pktcreload) {
477  sched_yield();
478  }
479 
480  if (cmd == GATE_SET_HAVE_GATEID && gate) {
481  ast_debug(3, "------- gate modify gateid 0x%x ssip: 0x%x\n", gate->gateid, ssip);
482  /* TODO implement it */
483  ast_log(LOG_WARNING, "Modify GateID not implemented\n");
484  }
485 
486  if ((gate = cops_gate_cmd(cmd, NULL, cops_trid++, mta, actcount, bitrate, psize, ssip, ssport, gate))) {
487  ast_debug(3, "COPS: Allocating gate for mta: 0x%x\n", mta);
488  gate->got_dq_gi = got_dq_gi;
489  gate->gate_remove = gate_remove;
490  return(gate);
491  } else {
492  ast_debug(3, "COPS: Couldn't allocate gate for mta: 0x%x\n", mta);
493  return NULL;
494  }
495 }
int(* gate_remove)(struct cops_gate *gate)
Definition: pktccops.h:65
#define LOG_WARNING
Definition: logger.h:144
static struct cops_gate * cops_gate_cmd(int cmd, struct cops_cmts *cmts, uint16_t trid, uint32_t mta, uint32_t actcount, float bitrate, uint32_t psize, uint32_t ssip, uint16_t ssport, struct cops_gate *gate)
Definition: res_pktccops.c:497
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:236
uint32_t gateid
Definition: pktccops.h:55
static int pktcreload
Definition: res_pktccops.c:164
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
Definition: logger.c:1207
static uint16_t cops_trid
Definition: res_pktccops.c:92
int(* got_dq_gi)(struct cops_gate *gate)
Definition: pktccops.h:64