nsssrv_packet.c revision 795e12d8315c4f7f0d4b2abb77fb49e0417e362a
/*
SSSD
NSS Responder, command parser
Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <errno.h>
#include "talloc.h"
#define NSSSRV_PACKET_MEM_SIZE 512
struct nss_packet {
/* header */
/* io pointer */
};
/*
* Allocate a new packet structure
*
* - if size is defined use it otherwise the default packet will be
* NSSSRV_PACKET_MEM_SIZE bytes.
*/
enum sss_nss_command cmd,
struct nss_packet **rpacket)
{
struct nss_packet *packet;
if (size) {
} else {
}
return ENOMEM;
}
return EOK;
}
/* grows a packet size only in NSSSRV_PACKET_MEM_SIZE chunks */
{
if (size == 0) {
return EOK;
}
/* make sure we do not overflow */
totlen += n * NSSSRV_PACKET_MEM_SIZE;
return EINVAL;
}
}
if (!newmem) {
return ENOMEM;
}
}
return 0;
}
{
void *buf;
/* check for wrapping */
return EINVAL;
}
errno = 0;
return EAGAIN;
}
if (rb == 0) {
return ENODATA;
}
return EINVAL;
}
return EAGAIN;
}
return EAGAIN;
}
return EOK;
}
{
void *buf;
errno = 0;
return EAGAIN;
}
if (rb == 0) {
return EIO;
}
return EAGAIN;
}
return EOK;
}
{
}
{
}
{
}